<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.5"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>SWM34S_LVGL7.11_SWMUI: C:/Users/DELL/Desktop/Commit/lvgl/SWM34S_LVGL7.11_SWMUI_20230515/APP/Common Module/load_mv.c 源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">SWM34S_LVGL7.11_SWMUI<span id="projectnumber">&#160;V7.9</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.5 -->
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_0ca16891106f5a3e9ad635a0d6c5f98f.html">APP</a></li><li class="navelem"><a class="el" href="dir_df4e0e4e72f77ab290fd1a24f190250a.html">Common Module</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle"><div class="title">load_mv.c</div></div>
</div><!--header-->
<div class="contents">
<a href="load__mv_8c.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span> </div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno">   35</span><span class="preprocessor">#include &lt;string.h&gt;</span></div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno">   36</span><span class="preprocessor">#include &quot;ff.h&quot;</span></div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno">   37</span><span class="preprocessor">#include &quot;<a class="code" href="avi__parser_8h.html">avi_parser.h</a>&quot;</span></div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno">   38</span><span class="preprocessor">#include &quot;<a class="code" href="wav__parser_8h.html">wav_parser.h</a>&quot;</span></div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno">   39</span><span class="preprocessor">#include &quot;<a class="code" href="posix__fsm_8h.html">posix_fsm.h</a>&quot;</span></div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno">   40</span><span class="preprocessor">#include &quot;<a class="code" href="bsp__init_8h.html">bsp_init.h</a>&quot;</span></div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno">   41</span> </div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno">   42</span><span class="preprocessor">#include &quot;<a class="code" href="load__mv_8h.html">load_mv.h</a>&quot;</span></div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno">   43</span> </div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno">   44</span><span class="preprocessor">#include &quot;<a class="code" href="mem__sdram_8h.html">mem_sdram.h</a>&quot;</span></div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno">   45</span><span class="preprocessor">#include &quot;<a class="code" href="log_8h.html">log.h</a>&quot;</span></div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno">   46</span> </div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno">   47</span><span class="comment">/*******************************************************************************************************************************************</span></div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno">   48</span><span class="comment"> * Private Define</span></div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno">   49</span><span class="comment"> *******************************************************************************************************************************************/</span></div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"><a class="line" href="load__mv_8c.html#a127a925bbc489eb0be2849086588a258">   50</a></span><span class="preprocessor">#define MV_DEBUG_ENABLE </span></div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno">   53</span><span class="preprocessor">#ifdef MV_DEBUG_ENABLE</span></div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"><a class="line" href="load__mv_8c.html#abd1e47f634a69dfe15a08cf0ca6219b0">   54</a></span><span class="preprocessor">    #define MV_LOG(...)         LOG_INFO(__VA_ARGS__) </span><span class="comment">// printf(__VA_ARGS__)</span></div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno">   55</span><span class="preprocessor">#else</span></div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno">   56</span><span class="preprocessor">    #define MV_LOG(...)</span></div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno">   57</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno">   58</span> </div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"><a class="line" href="load__mv_8c.html#a35c6cf21059ba899b846d63b5224dc54">   60</a></span><span class="preprocessor">#define TIMR_AVI                    BTIMR0</span></div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno">   61</span> </div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno">   62</span><span class="comment">/* 音频数据缓冲区不可放到 SDRAM 内，因 DMA -&gt; DAC 会与 LCD_DMA 竞争 SDRAM 带宽，</span></div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno">   63</span><span class="comment"> * 导致 LCD 的 DCLK 在数据发送过程中会中断停止，实测表现为屏幕显示闪烁/晃动, 故堆不可设置在 SDRAM.</span></div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno">   64</span><span class="comment"> */</span></div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"><a class="line" href="load__mv_8c.html#aa7c703137502abaebf7487b6d19a7565">   65</a></span><span class="preprocessor">#define PCM_BUFSIZE         (2048) </span></div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno">   67</span><span class="comment">/*******************************************************************************************************************************************</span></div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno">   68</span><span class="comment"> * Private Typedef</span></div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno">   69</span><span class="comment"> *******************************************************************************************************************************************/</span></div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"><a class="line" href="structppbuf__t.html">   71</a></span><span class="keyword">typedef</span> <span class="keyword">struct</span></div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno">   72</span>{</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"><a class="line" href="structppbuf__t.html#aba0654c8fda9f3e4182659c72e1f3942">   73</a></span>    int16_t *<a class="code hl_variable" href="structppbuf__t.html#aba0654c8fda9f3e4182659c72e1f3942">buf</a>;</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"><a class="line" href="structppbuf__t.html#ae68c54fbb92dacb8fa2a18389de52f9f">   74</a></span>    <span class="keyword">volatile</span> uint8_t <a class="code hl_variable" href="structppbuf__t.html#ae68c54fbb92dacb8fa2a18389de52f9f">ping</a> : 1;</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"><a class="line" href="structppbuf__t.html#a29d6f26ef78cbf28c7570503a278b73d">   75</a></span>    <span class="keyword">volatile</span> uint8_t <a class="code hl_variable" href="structppbuf__t.html#a29d6f26ef78cbf28c7570503a278b73d">pong</a> : 1;</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno">   76</span>} <a class="code hl_struct" href="structppbuf__t.html">ppbuf_t</a>;</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno">   77</span> </div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"><a class="line" href="load__mv_8c.html#aefd70b8b91d72cbd548b6c38f385983b">   79</a></span><span class="keyword">typedef</span> <span class="keyword">enum</span></div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno">   80</span>{</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"><a class="line" href="load__mv_8c.html#aefd70b8b91d72cbd548b6c38f385983bab470eb20dd049d7bdce38bc9ae5f0db1">   81</a></span>    <a class="code hl_enumvalue" href="load__mv_8c.html#aefd70b8b91d72cbd548b6c38f385983bab470eb20dd049d7bdce38bc9ae5f0db1">fsm_state_idle</a> = 0, </div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"><a class="line" href="load__mv_8c.html#aefd70b8b91d72cbd548b6c38f385983ba670e07d99593e66c665616d780ffb00e">   82</a></span>    <a class="code hl_enumvalue" href="load__mv_8c.html#aefd70b8b91d72cbd548b6c38f385983ba670e07d99593e66c665616d780ffb00e">fsm_state_run_avi</a>,  </div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno">   83</span>    <a class="code hl_enumvalue" href="load__mv_8c.html#aefd70b8b91d72cbd548b6c38f385983bad9853dc519c747cd4515e80a7b242ea8">fsm_state_run_wav</a>   </div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"><a class="line" href="load__mv_8c.html#aefd70b8b91d72cbd548b6c38f385983bad9853dc519c747cd4515e80a7b242ea8">   84</a></span>} <a class="code hl_enumeration" href="load__mv_8c.html#aefd70b8b91d72cbd548b6c38f385983b">fsm_state_t</a>;</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno">   85</span> </div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"><a class="line" href="load__mv_8c.html#a493217321e8eec123f3a1a788dddcf11">   87</a></span><span class="keyword">typedef</span> <span class="keyword">enum</span></div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno">   88</span>{</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"><a class="line" href="load__mv_8c.html#a493217321e8eec123f3a1a788dddcf11a0eebdd5efb02ae138999a818a5ace4a0">   89</a></span>    <a class="code hl_enumvalue" href="load__mv_8c.html#a493217321e8eec123f3a1a788dddcf11a0eebdd5efb02ae138999a818a5ace4a0">fsm_event_idle</a> = 0,   </div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"><a class="line" href="load__mv_8c.html#a493217321e8eec123f3a1a788dddcf11a0006b5f2d91ef6c7cdbff7065bdbd49e">   90</a></span>    <a class="code hl_enumvalue" href="load__mv_8c.html#a493217321e8eec123f3a1a788dddcf11a0006b5f2d91ef6c7cdbff7065bdbd49e">fsm_event_parser_avi</a>, </div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"><a class="line" href="load__mv_8c.html#a493217321e8eec123f3a1a788dddcf11ae7d904538ea9727252edd4bd8d44a30d">   91</a></span>    <a class="code hl_enumvalue" href="load__mv_8c.html#a493217321e8eec123f3a1a788dddcf11ae7d904538ea9727252edd4bd8d44a30d">fsm_event_parser_wav</a>, </div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"><a class="line" href="load__mv_8c.html#a493217321e8eec123f3a1a788dddcf11ade45d40e28be11dd81a75ab2f78f9a9f">   92</a></span>    <a class="code hl_enumvalue" href="load__mv_8c.html#a493217321e8eec123f3a1a788dddcf11ade45d40e28be11dd81a75ab2f78f9a9f">fsm_event_decode</a>,     </div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno">   93</span>    <a class="code hl_enumvalue" href="load__mv_8c.html#a493217321e8eec123f3a1a788dddcf11a170564aa26b89d074cf288e97ba94209">fsm_event_close</a>       </div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"><a class="line" href="load__mv_8c.html#a493217321e8eec123f3a1a788dddcf11a170564aa26b89d074cf288e97ba94209">   94</a></span>} <a class="code hl_enumeration" href="load__mv_8c.html#a493217321e8eec123f3a1a788dddcf11">fsm_event_t</a>;</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno">   95</span> </div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"><a class="line" href="load__mv_8c.html#a3d600ad47f709a0dcfa5cbf1a00fc31a">   97</a></span><span class="keyword">typedef</span> <span class="keyword">enum</span></div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno">   98</span>{</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"><a class="line" href="load__mv_8c.html#a3d600ad47f709a0dcfa5cbf1a00fc31aa0d077f5b932ce05e5b9f30c6087a2f31">   99</a></span>    <a class="code hl_enumvalue" href="load__mv_8c.html#a3d600ad47f709a0dcfa5cbf1a00fc31aa0d077f5b932ce05e5b9f30c6087a2f31">NO</a> = 0, </div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno">  100</span>    <a class="code hl_enumvalue" href="load__mv_8c.html#a3d600ad47f709a0dcfa5cbf1a00fc31aa2bc49ec37d6a5715dd23e85f1ff5bb59">OK</a>      </div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno">  101</span>    <span class="comment">/* 可以枚举拓展 ++ 累计触发次数 */</span></div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"><a class="line" href="load__mv_8c.html#a3d600ad47f709a0dcfa5cbf1a00fc31aa2bc49ec37d6a5715dd23e85f1ff5bb59">  102</a></span>} <a class="code hl_enumeration" href="load__mv_8c.html#a3d600ad47f709a0dcfa5cbf1a00fc31a">irq_flag_t</a>;</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno">  103</span> </div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno">  104</span><span class="comment">/*******************************************************************************************************************************************</span></div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno">  105</span><span class="comment"> * Private Prototype</span></div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno">  106</span><span class="comment"> *******************************************************************************************************************************************/</span></div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno">  107</span><span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code hl_function" href="load__mv_8c.html#a904f1d788d926c7864c948c4f9d1c66f">cb_parser_avi</a>(<span class="keywordtype">void</span> *);</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno">  108</span><span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code hl_function" href="load__mv_8c.html#a3a29f68f2d856a9c2eea3a328d5233e8">cb_decode_avi</a>(<span class="keywordtype">void</span> *);</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno">  109</span><span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code hl_function" href="load__mv_8c.html#a978ed993bd878f76db92c810771c0ee8">cb_close_avi</a>(<span class="keywordtype">void</span> *);</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno">  110</span> </div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno">  111</span><span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code hl_function" href="load__mv_8c.html#a0beb39d84c085c9baadb8a933edf1e53">cb_parser_wav</a>(<span class="keywordtype">void</span> *);</div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno">  112</span><span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code hl_function" href="load__mv_8c.html#ade87c0786f4382f3e221f3a79cef3a01">cb_decode_wav</a>(<span class="keywordtype">void</span> *);</div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno">  113</span><span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code hl_function" href="load__mv_8c.html#a79e1ebe637dcb48c69706eb81c73b576">cb_close_wav</a>(<span class="keywordtype">void</span> *);</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno">  114</span> </div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno">  115</span><span class="comment">/*******************************************************************************************************************************************</span></div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno">  116</span><span class="comment"> * Private Variable</span></div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno">  117</span><span class="comment"> *******************************************************************************************************************************************/</span></div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"><a class="line" href="load__mv_8c.html#a03ef2b3ebf33b58442ece296ef64254b">  119</a></span><span class="keyword">static</span> <span class="keyword">const</span> <a class="code hl_struct" href="structfsm__handle__t.html">fsm_handle_t</a> <a class="code hl_variable" href="load__mv_8c.html#a03ef2b3ebf33b58442ece296ef64254b">FSM_Event_Table</a>[] = {</div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno">  120</span>    <span class="comment">/* 初态                 触发事件                动作回调        次态 */</span></div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno">  121</span>    <span class="comment">//  {fsm_state_idle     , fsm_event_idle        , NULL          , fsm_state_idle},</span></div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno">  122</span> </div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno">  123</span>    {<a class="code hl_enumvalue" href="load__mv_8c.html#aefd70b8b91d72cbd548b6c38f385983bab470eb20dd049d7bdce38bc9ae5f0db1">fsm_state_idle</a>, <a class="code hl_enumvalue" href="load__mv_8c.html#a493217321e8eec123f3a1a788dddcf11a0006b5f2d91ef6c7cdbff7065bdbd49e">fsm_event_parser_avi</a>, <a class="code hl_function" href="load__mv_8c.html#a904f1d788d926c7864c948c4f9d1c66f">cb_parser_avi</a>, <a class="code hl_enumvalue" href="load__mv_8c.html#aefd70b8b91d72cbd548b6c38f385983ba670e07d99593e66c665616d780ffb00e">fsm_state_run_avi</a>},</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno">  124</span>    {<a class="code hl_enumvalue" href="load__mv_8c.html#aefd70b8b91d72cbd548b6c38f385983bab470eb20dd049d7bdce38bc9ae5f0db1">fsm_state_idle</a>, <a class="code hl_enumvalue" href="load__mv_8c.html#a493217321e8eec123f3a1a788dddcf11ae7d904538ea9727252edd4bd8d44a30d">fsm_event_parser_wav</a>, <a class="code hl_function" href="load__mv_8c.html#a0beb39d84c085c9baadb8a933edf1e53">cb_parser_wav</a>, <a class="code hl_enumvalue" href="load__mv_8c.html#aefd70b8b91d72cbd548b6c38f385983bad9853dc519c747cd4515e80a7b242ea8">fsm_state_run_wav</a>},</div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno">  125</span> </div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno">  126</span>    {<a class="code hl_enumvalue" href="load__mv_8c.html#aefd70b8b91d72cbd548b6c38f385983ba670e07d99593e66c665616d780ffb00e">fsm_state_run_avi</a>, <a class="code hl_enumvalue" href="load__mv_8c.html#a493217321e8eec123f3a1a788dddcf11ade45d40e28be11dd81a75ab2f78f9a9f">fsm_event_decode</a>, <a class="code hl_function" href="load__mv_8c.html#a3a29f68f2d856a9c2eea3a328d5233e8">cb_decode_avi</a>, <a class="code hl_enumvalue" href="load__mv_8c.html#aefd70b8b91d72cbd548b6c38f385983ba670e07d99593e66c665616d780ffb00e">fsm_state_run_avi</a>},</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno">  127</span>    {<a class="code hl_enumvalue" href="load__mv_8c.html#aefd70b8b91d72cbd548b6c38f385983ba670e07d99593e66c665616d780ffb00e">fsm_state_run_avi</a>, <a class="code hl_enumvalue" href="load__mv_8c.html#a493217321e8eec123f3a1a788dddcf11a170564aa26b89d074cf288e97ba94209">fsm_event_close</a>, <a class="code hl_function" href="load__mv_8c.html#a978ed993bd878f76db92c810771c0ee8">cb_close_avi</a>, <a class="code hl_enumvalue" href="load__mv_8c.html#aefd70b8b91d72cbd548b6c38f385983bab470eb20dd049d7bdce38bc9ae5f0db1">fsm_state_idle</a>},</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno">  128</span> </div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno">  129</span>    {<a class="code hl_enumvalue" href="load__mv_8c.html#aefd70b8b91d72cbd548b6c38f385983bad9853dc519c747cd4515e80a7b242ea8">fsm_state_run_wav</a>, <a class="code hl_enumvalue" href="load__mv_8c.html#a493217321e8eec123f3a1a788dddcf11ade45d40e28be11dd81a75ab2f78f9a9f">fsm_event_decode</a>, <a class="code hl_function" href="load__mv_8c.html#ade87c0786f4382f3e221f3a79cef3a01">cb_decode_wav</a>, <a class="code hl_enumvalue" href="load__mv_8c.html#aefd70b8b91d72cbd548b6c38f385983bad9853dc519c747cd4515e80a7b242ea8">fsm_state_run_wav</a>},</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno">  130</span>    {<a class="code hl_enumvalue" href="load__mv_8c.html#aefd70b8b91d72cbd548b6c38f385983bad9853dc519c747cd4515e80a7b242ea8">fsm_state_run_wav</a>, <a class="code hl_enumvalue" href="load__mv_8c.html#a493217321e8eec123f3a1a788dddcf11a170564aa26b89d074cf288e97ba94209">fsm_event_close</a>, <a class="code hl_function" href="load__mv_8c.html#a79e1ebe637dcb48c69706eb81c73b576">cb_close_wav</a>, <a class="code hl_enumvalue" href="load__mv_8c.html#aefd70b8b91d72cbd548b6c38f385983bab470eb20dd049d7bdce38bc9ae5f0db1">fsm_state_idle</a>},</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno">  131</span>};</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno">  132</span> </div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"><a class="line" href="load__mv_8c.html#a7b04ea3ab24f188f71239a1d3b808030">  134</a></span><span class="keyword">static</span> <a class="code hl_struct" href="structfsm__t.html">fsm_t</a> <a class="code hl_variable" href="load__mv_8c.html#a7b04ea3ab24f188f71239a1d3b808030">FSM</a> = {</div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno">  135</span>    .<a class="code hl_variable" href="structfsm__t.html#a1de5159247bef46fcdced877da3efdea">table</a> = (<a class="code hl_struct" href="structfsm__handle__t.html">fsm_handle_t</a> *)<a class="code hl_variable" href="load__mv_8c.html#a03ef2b3ebf33b58442ece296ef64254b">FSM_Event_Table</a>,</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno">  136</span>    .table_num = <span class="keyword">sizeof</span>(<a class="code hl_variable" href="load__mv_8c.html#a03ef2b3ebf33b58442ece296ef64254b">FSM_Event_Table</a>) / <span class="keyword">sizeof</span>(<a class="code hl_variable" href="load__mv_8c.html#a03ef2b3ebf33b58442ece296ef64254b">FSM_Event_Table</a>[0])</div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno">  137</span>};</div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno">  138</span> </div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"><a class="line" href="load__mv_8c.html#abe7750a41e8ce4686680033dcc321cec">  140</a></span><span class="keyword">static</span> <a class="code hl_enumeration" href="load__mv_8c.html#a493217321e8eec123f3a1a788dddcf11">fsm_event_t</a> <a class="code hl_variable" href="load__mv_8c.html#abe7750a41e8ce4686680033dcc321cec">Event_ID</a> = <a class="code hl_enumvalue" href="load__mv_8c.html#a493217321e8eec123f3a1a788dddcf11a0eebdd5efb02ae138999a818a5ace4a0">fsm_event_idle</a>;</div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno">  141</span> </div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"><a class="line" href="load__mv_8c.html#a3a3e1add9e325bafcb5ce220c4cf75bd">  143</a></span><span class="keyword">static</span> int16_t <a class="code hl_variable" href="load__mv_8c.html#a3a3e1add9e325bafcb5ce220c4cf75bd">Audio_PCM_Buff</a>[<a class="code hl_define" href="load__mv_8c.html#aa7c703137502abaebf7487b6d19a7565">PCM_BUFSIZE</a> * 2];</div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"><a class="line" href="load__mv_8c.html#a23bd76710e0085785dc0c07eee9f562b">  145</a></span><span class="keyword">static</span> <a class="code hl_struct" href="structppbuf__t.html">ppbuf_t</a> <a class="code hl_variable" href="load__mv_8c.html#a23bd76710e0085785dc0c07eee9f562b">Audio_Control</a> = {&amp;<a class="code hl_variable" href="load__mv_8c.html#a3a3e1add9e325bafcb5ce220c4cf75bd">Audio_PCM_Buff</a>[0], 0, 1};</div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno">  146</span> </div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"><a class="line" href="load__mv_8c.html#acc289e18199098eb1e60099e71ce5476">  148</a></span><span class="keyword">static</span> jpeg_outset_t <a class="code hl_variable" href="load__mv_8c.html#acc289e18199098eb1e60099e71ce5476">Video_OutSet</a>;</div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno">  149</span> </div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno">  150</span><span class="comment">/* 播放媒体时的相关信息 */</span></div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"><a class="line" href="load__mv_8c.html#a4dad906d6569beca6b524a122e5ebb11">  151</a></span><span class="keyword">static</span> FIL <a class="code hl_variable" href="load__mv_8c.html#a4dad906d6569beca6b524a122e5ebb11">File_Handle</a>;                               </div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"><a class="line" href="load__mv_8c.html#a270fa9b5805fcc89bfb0c3f0bcf77c4d">  152</a></span><span class="keyword">static</span> uint32_t <a class="code hl_variable" href="load__mv_8c.html#a270fa9b5805fcc89bfb0c3f0bcf77c4d">Restart_Stream_ID</a> = 0;                </div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"><a class="line" href="load__mv_8c.html#a466f231c4630e48f95aa5980f6d0cc42">  153</a></span><span class="keyword">static</span> uint32_t <a class="code hl_variable" href="load__mv_8c.html#a466f231c4630e48f95aa5980f6d0cc42">Restart_Offset</a> = 0;                   </div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"><a class="line" href="load__mv_8c.html#adf6b06c522e8f78610aa821eff3a2508">  154</a></span><span class="keyword">static</span> uint32_t <a class="code hl_variable" href="load__mv_8c.html#adf6b06c522e8f78610aa821eff3a2508">Restart_StreamSize</a> = 0;               </div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"><a class="line" href="load__mv_8c.html#a47fdfbb31eda448a7ec364e2e724c2b7">  155</a></span><span class="keyword">static</span> <span class="keyword">volatile</span> uint32_t <a class="code hl_variable" href="load__mv_8c.html#a47fdfbb31eda448a7ec364e2e724c2b7">Video_Loop_Nums</a> = 0;         </div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"><a class="line" href="load__mv_8c.html#adc415ff7c829fa6c6a78755deccbc10d">  156</a></span><span class="keyword">static</span> <span class="keyword">volatile</span> uint32_t <a class="code hl_variable" href="load__mv_8c.html#adc415ff7c829fa6c6a78755deccbc10d">Video_Loop_Max</a> = 0xFFFFFFFF; </div>
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"><a class="line" href="load__mv_8c.html#a492fd8587926eace74ba1054485d66b5">  159</a></span><span class="keyword">static</span> <span class="keyword">volatile</span> <a class="code hl_enumeration" href="dev__dac_8c.html#a3d600ad47f709a0dcfa5cbf1a00fc31a">irq_flag_t</a> <a class="code hl_variable" href="load__mv_8c.html#a492fd8587926eace74ba1054485d66b5">IRQ_Flag_Frame</a> = <a class="code hl_enumvalue" href="load__mv_8c.html#a3d600ad47f709a0dcfa5cbf1a00fc31aa0d077f5b932ce05e5b9f30c6087a2f31">NO</a>; </div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno">  160</span> </div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno">  161</span><span class="comment">/*******************************************************************************************************************************************</span></div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno">  162</span><span class="comment"> * Public Constant</span></div>
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno">  163</span><span class="comment"> *******************************************************************************************************************************************/</span></div>
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"><a class="line" href="load__mv_8c.html#a158fc3faa30ddbece4360f3114710212">  165</a></span><span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code hl_variable" href="load__mv_8c.html#a158fc3faa30ddbece4360f3114710212">Debug_FR_Table</a>[] =</div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno">  166</span>    {</div>
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno">  167</span>        <span class="stringliteral">&quot;FR_OK：成功&quot;</span>,                                          <span class="comment">// (0) Succeeded</span></div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno">  168</span>        <span class="stringliteral">&quot;FR_DISK_ERR：底层硬件错误&quot;</span>,                            <span class="comment">// (1) A hard error occurred in the low level disk I/O layer</span></div>
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno">  169</span>        <span class="stringliteral">&quot;FR_INT_ERR：断言失败&quot;</span>,                                   <span class="comment">// (2) Assertion failed</span></div>
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno">  170</span>        <span class="stringliteral">&quot;FR_NOT_READY：物理驱动没有工作&quot;</span>,                         <span class="comment">// (3) The physical drive cannot work</span></div>
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno">  171</span>        <span class="stringliteral">&quot;FR_NO_FILE：文件不存在&quot;</span>,                              <span class="comment">// (4) Could not find the file</span></div>
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno">  172</span>        <span class="stringliteral">&quot;FR_NO_PATH：路径不存在&quot;</span>,                              <span class="comment">// (5) Could not find the path</span></div>
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno">  173</span>        <span class="stringliteral">&quot;FR_INVALID_NAME：无效文件名&quot;</span>,                             <span class="comment">// (6) The path name format is invalid</span></div>
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno">  174</span>        <span class="stringliteral">&quot;FR_DENIED：由于禁止访问或者目录已满访问被拒绝&quot;</span>,       <span class="comment">// (7) Access denied due to prohibited access or directory full</span></div>
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno">  175</span>        <span class="stringliteral">&quot;FR_EXIST：由于访问被禁止访问被拒绝&quot;</span>,                     <span class="comment">// (8) Access denied due to prohibited access</span></div>
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno">  176</span>        <span class="stringliteral">&quot;FR_INVALID_OBJECT：文件或者目录对象无效&quot;</span>,              <span class="comment">// (9) The file/directory object is invalid</span></div>
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno">  177</span>        <span class="stringliteral">&quot;FR_WRITE_PROTECTED：物理驱动被写保护&quot;</span>,                   <span class="comment">// (10) The physical drive is write protected</span></div>
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno">  178</span>        <span class="stringliteral">&quot;FR_INVALID_DRIVE：逻辑驱动号无效&quot;</span>,                      <span class="comment">// (11) The logical drive number is invalid</span></div>
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno">  179</span>        <span class="stringliteral">&quot;FR_NOT_ENABLED：卷中无工作区&quot;</span>,                             <span class="comment">// (12) The volume has no work area</span></div>
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno">  180</span>        <span class="stringliteral">&quot;FR_NO_FILESYSTEM：没有有效的FAT卷&quot;</span>,                    <span class="comment">// (13) There is no valid FAT volume</span></div>
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno">  181</span>        <span class="stringliteral">&quot;FR_MKFS_ABORTED：由于参数错误f_mkfs()被终止&quot;</span>,             <span class="comment">// (14) The f_mkfs() aborted due to any parameter error</span></div>
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno">  182</span>        <span class="stringliteral">&quot;FR_TIMEOUT：在规定的时间内无法获得访问卷的许可&quot;</span>,      <span class="comment">// (15) Could not get a grant to access the volume within defined period</span></div>
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno">  183</span>        <span class="stringliteral">&quot;FR_LOCKED：由于文件共享策略操作被拒绝&quot;</span>,               <span class="comment">// (16) The operation is rejected according to the file sharing policy</span></div>
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno">  184</span>        <span class="stringliteral">&quot;FR_NOT_ENOUGH_CORE：无法分配长文件名工作区&quot;</span>,            <span class="comment">// (17) LFN working buffer could not be allocated</span></div>
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno">  185</span>        <span class="stringliteral">&quot;FR_TOO_MANY_OPEN_FILES：当前打开的文件数大于_FS_SHARE&quot;</span>, <span class="comment">// (18) Number of open files &gt; _FS_SHARE</span></div>
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno">  186</span>        <span class="stringliteral">&quot;FR_INVALID_PARAMETER：参数无效&quot;</span>                      <span class="comment">// (19) Given parameter is invalid</span></div>
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno">  187</span>};</div>
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno">  188</span> </div>
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno">  189</span><span class="comment">/*******************************************************************************************************************************************</span></div>
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno">  190</span><span class="comment"> * Public Function</span></div>
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno">  191</span><span class="comment"> *******************************************************************************************************************************************/</span></div>
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"><a class="line" href="load__mv_8c.html#a6ce56145e8e2449ba3049c2a622e84b6">  196</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="load__mv_8c.html#a6ce56145e8e2449ba3049c2a622e84b6">isr_btimer_avi</a>(<span class="keywordtype">void</span>)</div>
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno">  197</span>{</div>
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno">  198</span>    <a class="code hl_define" href="load__mv_8c.html#a35c6cf21059ba899b846d63b5224dc54">TIMR_AVI</a>-&gt;IF = (1 &lt;&lt; TIMR_IF_TO_Pos); <span class="comment">/* TIMR_INTClr(TIMR_AVI); */</span></div>
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno">  199</span>    </div>
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno">  200</span>    <a class="code hl_variable" href="load__mv_8c.html#a492fd8587926eace74ba1054485d66b5">IRQ_Flag_Frame</a> = <a class="code hl_enumvalue" href="load__mv_8c.html#a3d600ad47f709a0dcfa5cbf1a00fc31aa2bc49ec37d6a5715dd23e85f1ff5bb59">OK</a>;</div>
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno">  201</span>}</div>
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno">  202</span> </div>
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno"><a class="line" href="load__mv_8c.html#a4baf0d2c0d6e1fea0ddb9867c9747f8b">  211</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="load__mv_8c.html#a4baf0d2c0d6e1fea0ddb9867c9747f8b">mv_task_handler</a>(<span class="keywordtype">void</span>)</div>
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno">  212</span>{</div>
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno">  213</span>    <span class="keywordflow">if</span> (<a class="code hl_variable" href="load__mv_8c.html#abe7750a41e8ce4686680033dcc321cec">Event_ID</a> == <a class="code hl_enumvalue" href="load__mv_8c.html#a493217321e8eec123f3a1a788dddcf11a0eebdd5efb02ae138999a818a5ace4a0">fsm_event_idle</a>)</div>
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno">  214</span>        <span class="keywordflow">return</span> 1;</div>
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno">  215</span> </div>
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno">  216</span>    <span class="keywordflow">return</span> ((<a class="code hl_enumvalue" href="posix__fsm_8h.html#a21f736acd6f712522de85c096c7ec091aabaf50596722b188e2a14557e0de4630">FSM_RT_OK</a> == <a class="code hl_function" href="posix__fsm_8c.html#a0b1b28d5d26c97b4c934f7822c1a7a04">fsm_event_exec</a>(&amp;<a class="code hl_variable" href="load__mv_8c.html#a7b04ea3ab24f188f71239a1d3b808030">FSM</a>, <a class="code hl_variable" href="load__mv_8c.html#abe7750a41e8ce4686680033dcc321cec">Event_ID</a>, NULL)) ? 0 : -1);</div>
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno">  217</span>}</div>
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno">  218</span> </div>
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno"><a class="line" href="load__mv_8c.html#ab03d657977c16952b0a16e589fbd6e71">  224</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="load__mv_8c.html#ab03d657977c16952b0a16e589fbd6e71">mv_task_over</a>(<span class="keywordtype">void</span>)</div>
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno">  225</span>{</div>
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno">  226</span>    <a class="code hl_enumeration" href="posix__fsm_8h.html#a21f736acd6f712522de85c096c7ec091">fsm_result</a> res;</div>
<div class="line"><a id="l00227" name="l00227"></a><span class="lineno">  227</span>    <span class="keywordtype">int</span> now_state = 0;</div>
<div class="line"><a id="l00228" name="l00228"></a><span class="lineno">  228</span>    res = <a class="code hl_function" href="posix__fsm_8c.html#a02397a7a821d3ddd678b34eea5e94054">fsm_state_get</a>(&amp;<a class="code hl_variable" href="load__mv_8c.html#a7b04ea3ab24f188f71239a1d3b808030">FSM</a>, &amp;now_state);</div>
<div class="line"><a id="l00229" name="l00229"></a><span class="lineno">  229</span>    <span class="keywordflow">if</span> (res != <a class="code hl_enumvalue" href="posix__fsm_8h.html#a21f736acd6f712522de85c096c7ec091aabaf50596722b188e2a14557e0de4630">FSM_RT_OK</a>)</div>
<div class="line"><a id="l00230" name="l00230"></a><span class="lineno">  230</span>    {</div>
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno">  231</span>        <a class="code hl_define" href="load__mv_8c.html#abd1e47f634a69dfe15a08cf0ca6219b0">MV_LOG</a>(<span class="stringliteral">&quot;[fsm_state_get] res = [%d]\r\n&quot;</span>, res);</div>
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno">  232</span>        <span class="keywordflow">return</span>;</div>
<div class="line"><a id="l00233" name="l00233"></a><span class="lineno">  233</span>    }</div>
<div class="line"><a id="l00234" name="l00234"></a><span class="lineno">  234</span> </div>
<div class="line"><a id="l00235" name="l00235"></a><span class="lineno">  235</span>    <span class="keywordflow">switch</span> (now_state)</div>
<div class="line"><a id="l00236" name="l00236"></a><span class="lineno">  236</span>    {</div>
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno">  237</span>    <span class="keywordflow">case</span> (<a class="code hl_enumvalue" href="load__mv_8c.html#aefd70b8b91d72cbd548b6c38f385983bab470eb20dd049d7bdce38bc9ae5f0db1">fsm_state_idle</a>):</div>
<div class="line"><a id="l00238" name="l00238"></a><span class="lineno">  238</span>        <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00239" name="l00239"></a><span class="lineno">  239</span> </div>
<div class="line"><a id="l00240" name="l00240"></a><span class="lineno">  240</span>    <span class="keywordflow">case</span> (<a class="code hl_enumvalue" href="load__mv_8c.html#aefd70b8b91d72cbd548b6c38f385983ba670e07d99593e66c665616d780ffb00e">fsm_state_run_avi</a>): <span class="comment">// break; //continue</span></div>
<div class="line"><a id="l00241" name="l00241"></a><span class="lineno">  241</span>    <span class="keywordflow">case</span> (<a class="code hl_enumvalue" href="load__mv_8c.html#aefd70b8b91d72cbd548b6c38f385983bad9853dc519c747cd4515e80a7b242ea8">fsm_state_run_wav</a>):</div>
<div class="line"><a id="l00242" name="l00242"></a><span class="lineno">  242</span>        res = <a class="code hl_function" href="posix__fsm_8c.html#a0b1b28d5d26c97b4c934f7822c1a7a04">fsm_event_exec</a>(&amp;<a class="code hl_variable" href="load__mv_8c.html#a7b04ea3ab24f188f71239a1d3b808030">FSM</a>, <a class="code hl_enumvalue" href="load__mv_8c.html#a493217321e8eec123f3a1a788dddcf11a170564aa26b89d074cf288e97ba94209">fsm_event_close</a>, NULL);</div>
<div class="line"><a id="l00243" name="l00243"></a><span class="lineno">  243</span>        <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00244" name="l00244"></a><span class="lineno">  244</span> </div>
<div class="line"><a id="l00245" name="l00245"></a><span class="lineno">  245</span>    <span class="keywordflow">default</span>:</div>
<div class="line"><a id="l00246" name="l00246"></a><span class="lineno">  246</span>        <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00247" name="l00247"></a><span class="lineno">  247</span>    }</div>
<div class="line"><a id="l00248" name="l00248"></a><span class="lineno">  248</span> </div>
<div class="line"><a id="l00249" name="l00249"></a><span class="lineno">  249</span>    <span class="keywordflow">if</span> (res == <a class="code hl_enumvalue" href="posix__fsm_8h.html#a21f736acd6f712522de85c096c7ec091aabaf50596722b188e2a14557e0de4630">FSM_RT_OK</a>)</div>
<div class="line"><a id="l00250" name="l00250"></a><span class="lineno">  250</span>    {</div>
<div class="line"><a id="l00251" name="l00251"></a><span class="lineno">  251</span>        <a class="code hl_variable" href="load__mv_8c.html#abe7750a41e8ce4686680033dcc321cec">Event_ID</a> = <a class="code hl_enumvalue" href="load__mv_8c.html#a493217321e8eec123f3a1a788dddcf11a0eebdd5efb02ae138999a818a5ace4a0">fsm_event_idle</a>;</div>
<div class="line"><a id="l00252" name="l00252"></a><span class="lineno">  252</span>    }</div>
<div class="line"><a id="l00253" name="l00253"></a><span class="lineno">  253</span>}</div>
<div class="line"><a id="l00254" name="l00254"></a><span class="lineno">  254</span> </div>
<div class="line"><a id="l00260" name="l00260"></a><span class="lineno"><a class="line" href="load__mv_8c.html#a7dd8d59698dc593d41250fc09a0ae5a5">  260</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="load__mv_8c.html#a7dd8d59698dc593d41250fc09a0ae5a5">mv_task_init</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *file_path)</div>
<div class="line"><a id="l00261" name="l00261"></a><span class="lineno">  261</span>{</div>
<div class="line"><a id="l00262" name="l00262"></a><span class="lineno">  262</span>    <a class="code hl_function" href="load__mv_8c.html#ab03d657977c16952b0a16e589fbd6e71">mv_task_over</a>(); <span class="comment">// 正在运行中打断, 需要先关闭</span></div>
<div class="line"><a id="l00263" name="l00263"></a><span class="lineno">  263</span> </div>
<div class="line"><a id="l00264" name="l00264"></a><span class="lineno">  264</span>    <span class="comment">// 以文件后缀名区分</span></div>
<div class="line"><a id="l00265" name="l00265"></a><span class="lineno">  265</span>    <span class="keywordflow">if</span> (NULL != strstr(file_path, <span class="stringliteral">&quot;.avi&quot;</span>))</div>
<div class="line"><a id="l00266" name="l00266"></a><span class="lineno">  266</span>    {</div>
<div class="line"><a id="l00267" name="l00267"></a><span class="lineno">  267</span>        <span class="keywordflow">if</span> (<a class="code hl_function" href="posix__fsm_8c.html#a0b1b28d5d26c97b4c934f7822c1a7a04">fsm_event_exec</a>(&amp;<a class="code hl_variable" href="load__mv_8c.html#a7b04ea3ab24f188f71239a1d3b808030">FSM</a>, <a class="code hl_enumvalue" href="load__mv_8c.html#a493217321e8eec123f3a1a788dddcf11a0006b5f2d91ef6c7cdbff7065bdbd49e">fsm_event_parser_avi</a>, (<span class="keywordtype">void</span> *)file_path) == <a class="code hl_enumvalue" href="posix__fsm_8h.html#a21f736acd6f712522de85c096c7ec091aabaf50596722b188e2a14557e0de4630">FSM_RT_OK</a>)</div>
<div class="line"><a id="l00268" name="l00268"></a><span class="lineno">  268</span>        {</div>
<div class="line"><a id="l00269" name="l00269"></a><span class="lineno">  269</span>            <a class="code hl_variable" href="load__mv_8c.html#abe7750a41e8ce4686680033dcc321cec">Event_ID</a> = <a class="code hl_enumvalue" href="load__mv_8c.html#a493217321e8eec123f3a1a788dddcf11ade45d40e28be11dd81a75ab2f78f9a9f">fsm_event_decode</a>;</div>
<div class="line"><a id="l00270" name="l00270"></a><span class="lineno">  270</span>        }</div>
<div class="line"><a id="l00271" name="l00271"></a><span class="lineno">  271</span>    }</div>
<div class="line"><a id="l00272" name="l00272"></a><span class="lineno">  272</span>    <span class="keywordflow">else</span> <span class="keywordflow">if</span> (NULL != strstr(file_path, <span class="stringliteral">&quot;.wav&quot;</span>))</div>
<div class="line"><a id="l00273" name="l00273"></a><span class="lineno">  273</span>    {</div>
<div class="line"><a id="l00274" name="l00274"></a><span class="lineno">  274</span>        <span class="keywordflow">if</span> (<a class="code hl_function" href="posix__fsm_8c.html#a0b1b28d5d26c97b4c934f7822c1a7a04">fsm_event_exec</a>(&amp;<a class="code hl_variable" href="load__mv_8c.html#a7b04ea3ab24f188f71239a1d3b808030">FSM</a>, <a class="code hl_enumvalue" href="load__mv_8c.html#a493217321e8eec123f3a1a788dddcf11ae7d904538ea9727252edd4bd8d44a30d">fsm_event_parser_wav</a>, (<span class="keywordtype">void</span> *)file_path) == <a class="code hl_enumvalue" href="posix__fsm_8h.html#a21f736acd6f712522de85c096c7ec091aabaf50596722b188e2a14557e0de4630">FSM_RT_OK</a>)</div>
<div class="line"><a id="l00275" name="l00275"></a><span class="lineno">  275</span>        {</div>
<div class="line"><a id="l00276" name="l00276"></a><span class="lineno">  276</span>            <a class="code hl_variable" href="load__mv_8c.html#abe7750a41e8ce4686680033dcc321cec">Event_ID</a> = <a class="code hl_enumvalue" href="load__mv_8c.html#a493217321e8eec123f3a1a788dddcf11ade45d40e28be11dd81a75ab2f78f9a9f">fsm_event_decode</a>;</div>
<div class="line"><a id="l00277" name="l00277"></a><span class="lineno">  277</span>        }</div>
<div class="line"><a id="l00278" name="l00278"></a><span class="lineno">  278</span>    }</div>
<div class="line"><a id="l00279" name="l00279"></a><span class="lineno">  279</span>    <span class="keywordflow">else</span> <span class="comment">// (unknown) other file format</span></div>
<div class="line"><a id="l00280" name="l00280"></a><span class="lineno">  280</span>    {</div>
<div class="line"><a id="l00281" name="l00281"></a><span class="lineno">  281</span>        <a class="code hl_variable" href="load__mv_8c.html#abe7750a41e8ce4686680033dcc321cec">Event_ID</a> = <a class="code hl_enumvalue" href="load__mv_8c.html#a493217321e8eec123f3a1a788dddcf11a0eebdd5efb02ae138999a818a5ace4a0">fsm_event_idle</a>;</div>
<div class="line"><a id="l00282" name="l00282"></a><span class="lineno">  282</span>        <a class="code hl_define" href="load__mv_8c.html#abd1e47f634a69dfe15a08cf0ca6219b0">MV_LOG</a>(<span class="stringliteral">&quot;[file_path] = [%s], It is unknown format!\r\n&quot;</span>, file_path);</div>
<div class="line"><a id="l00283" name="l00283"></a><span class="lineno">  283</span>    }</div>
<div class="line"><a id="l00284" name="l00284"></a><span class="lineno">  284</span>}</div>
<div class="line"><a id="l00285" name="l00285"></a><span class="lineno">  285</span> </div>
<div class="line"><a id="l00292" name="l00292"></a><span class="lineno"><a class="line" href="load__mv_8c.html#a2877cfdf885996dd8831a2a37660352d">  292</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="load__mv_8c.html#a2877cfdf885996dd8831a2a37660352d">mv_task_pause</a>(<span class="keywordtype">void</span>)</div>
<div class="line"><a id="l00293" name="l00293"></a><span class="lineno">  293</span>{</div>
<div class="line"><a id="l00294" name="l00294"></a><span class="lineno">  294</span>    <span class="keywordtype">int</span> now_state = 0;</div>
<div class="line"><a id="l00295" name="l00295"></a><span class="lineno">  295</span>    <a class="code hl_enumeration" href="posix__fsm_8h.html#a21f736acd6f712522de85c096c7ec091">fsm_result</a> res = <a class="code hl_function" href="posix__fsm_8c.html#a02397a7a821d3ddd678b34eea5e94054">fsm_state_get</a>(&amp;<a class="code hl_variable" href="load__mv_8c.html#a7b04ea3ab24f188f71239a1d3b808030">FSM</a>, &amp;now_state);</div>
<div class="line"><a id="l00296" name="l00296"></a><span class="lineno">  296</span>    <span class="keywordflow">if</span> (res == <a class="code hl_enumvalue" href="posix__fsm_8h.html#a21f736acd6f712522de85c096c7ec091aabaf50596722b188e2a14557e0de4630">FSM_RT_OK</a> &amp;&amp; now_state != <a class="code hl_enumvalue" href="load__mv_8c.html#aefd70b8b91d72cbd548b6c38f385983bab470eb20dd049d7bdce38bc9ae5f0db1">fsm_state_idle</a>)</div>
<div class="line"><a id="l00297" name="l00297"></a><span class="lineno">  297</span>    {</div>
<div class="line"><a id="l00298" name="l00298"></a><span class="lineno">  298</span>        TIMR_Halt(TIMR0);</div>
<div class="line"><a id="l00299" name="l00299"></a><span class="lineno">  299</span>    }</div>
<div class="line"><a id="l00300" name="l00300"></a><span class="lineno">  300</span>}</div>
<div class="line"><a id="l00301" name="l00301"></a><span class="lineno">  301</span> </div>
<div class="line"><a id="l00308" name="l00308"></a><span class="lineno"><a class="line" href="load__mv_8c.html#a913dfd46ff07efd13423f77b143fd156">  308</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="load__mv_8c.html#a913dfd46ff07efd13423f77b143fd156">mv_task_resume</a>(<span class="keywordtype">void</span>)</div>
<div class="line"><a id="l00309" name="l00309"></a><span class="lineno">  309</span>{</div>
<div class="line"><a id="l00310" name="l00310"></a><span class="lineno">  310</span>    <span class="keywordtype">int</span> now_state = 0;</div>
<div class="line"><a id="l00311" name="l00311"></a><span class="lineno">  311</span>    <a class="code hl_enumeration" href="posix__fsm_8h.html#a21f736acd6f712522de85c096c7ec091">fsm_result</a> res = <a class="code hl_function" href="posix__fsm_8c.html#a02397a7a821d3ddd678b34eea5e94054">fsm_state_get</a>(&amp;<a class="code hl_variable" href="load__mv_8c.html#a7b04ea3ab24f188f71239a1d3b808030">FSM</a>, &amp;now_state);</div>
<div class="line"><a id="l00312" name="l00312"></a><span class="lineno">  312</span>    <span class="keywordflow">if</span> (res == <a class="code hl_enumvalue" href="posix__fsm_8h.html#a21f736acd6f712522de85c096c7ec091aabaf50596722b188e2a14557e0de4630">FSM_RT_OK</a> &amp;&amp; now_state != <a class="code hl_enumvalue" href="load__mv_8c.html#aefd70b8b91d72cbd548b6c38f385983bab470eb20dd049d7bdce38bc9ae5f0db1">fsm_state_idle</a>)</div>
<div class="line"><a id="l00313" name="l00313"></a><span class="lineno">  313</span>    {</div>
<div class="line"><a id="l00314" name="l00314"></a><span class="lineno">  314</span>        TIMR_Resume(TIMR0);</div>
<div class="line"><a id="l00315" name="l00315"></a><span class="lineno">  315</span>    }</div>
<div class="line"><a id="l00316" name="l00316"></a><span class="lineno">  316</span>}</div>
<div class="line"><a id="l00317" name="l00317"></a><span class="lineno">  317</span> </div>
<div class="line"><a id="l00335" name="l00335"></a><span class="lineno"><a class="line" href="load__mv_8c.html#a9cbedc9a40c34ca836f988cc88f5640f">  335</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="load__mv_8c.html#a9cbedc9a40c34ca836f988cc88f5640f">lcd_set_alpha</a>(<a class="code hl_enumeration" href="load__mv_8h.html#ab9806189ae8983878b4853db01912f47">lcd_layer_t</a> lcd_layer, uint8_t alpha)</div>
<div class="line"><a id="l00336" name="l00336"></a><span class="lineno">  336</span>{</div>
<div class="line"><a id="l00337" name="l00337"></a><span class="lineno">  337</span>    LCD-&gt;L[lcd_layer].LCR &amp;= ~(0xFF &lt;&lt; LCD_LCR_ALPHA_Pos);</div>
<div class="line"><a id="l00338" name="l00338"></a><span class="lineno">  338</span>    LCD-&gt;L[lcd_layer].LCR |= (alpha &lt;&lt; LCD_LCR_ALPHA_Pos);</div>
<div class="line"><a id="l00339" name="l00339"></a><span class="lineno">  339</span> </div>
<div class="line"><a id="l00340" name="l00340"></a><span class="lineno">  340</span>    LCD-&gt;CR |= (1 &lt;&lt; LCD_CR_VBPRELOAD_Pos); <span class="comment">// 1 帧显示开始时，将层配置寄存器的值加载到层工作寄存器中</span></div>
<div class="line"><a id="l00341" name="l00341"></a><span class="lineno">  341</span>}</div>
<div class="line"><a id="l00342" name="l00342"></a><span class="lineno">  342</span> </div>
<div class="line"><a id="l00351" name="l00351"></a><span class="lineno"><a class="line" href="load__mv_8c.html#a6be0f2908cc5e6f47baae4138c8be510">  351</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="load__mv_8c.html#a6be0f2908cc5e6f47baae4138c8be510">lcd_set_color_key</a>(<a class="code hl_enumeration" href="load__mv_8h.html#ab9806189ae8983878b4853db01912f47">lcd_layer_t</a> lcd_layer, uint8_t color_key_enable, uint32_t rgb)</div>
<div class="line"><a id="l00352" name="l00352"></a><span class="lineno">  352</span>{</div>
<div class="line"><a id="l00353" name="l00353"></a><span class="lineno">  353</span>    <span class="keywordflow">if</span> (color_key_enable != 0)</div>
<div class="line"><a id="l00354" name="l00354"></a><span class="lineno">  354</span>    {</div>
<div class="line"><a id="l00355" name="l00355"></a><span class="lineno">  355</span>        LCD-&gt;L[lcd_layer].LCR |= (1 &lt;&lt; LCD_LCR_CKEN_Pos);</div>
<div class="line"><a id="l00356" name="l00356"></a><span class="lineno">  356</span> </div>
<div class="line"><a id="l00357" name="l00357"></a><span class="lineno">  357</span>        <span class="comment">// LCD_FORMAT 优先于 Color Key 配置</span></div>
<div class="line"><a id="l00358" name="l00358"></a><span class="lineno">  358</span><span class="preprocessor">#if (LCD_FMT == LCD_RGB565)</span></div>
<div class="line"><a id="l00359" name="l00359"></a><span class="lineno">  359</span>        LCD-&gt;L[lcd_layer].CK = rgb &amp; 0xFFFF;</div>
<div class="line"><a id="l00360" name="l00360"></a><span class="lineno">  360</span><span class="preprocessor">#elif (LCD_FMT == LCD_ARGB888)</span></div>
<div class="line"><a id="l00361" name="l00361"></a><span class="lineno">  361</span>        LCD-&gt;L[lcd_layer].CK = rgb;</div>
<div class="line"><a id="l00362" name="l00362"></a><span class="lineno">  362</span><span class="preprocessor">#endif </span><span class="comment">// LCD_FORMAT</span></div>
<div class="line"><a id="l00363" name="l00363"></a><span class="lineno">  363</span>    }</div>
<div class="line"><a id="l00364" name="l00364"></a><span class="lineno">  364</span>    <span class="keywordflow">else</span></div>
<div class="line"><a id="l00365" name="l00365"></a><span class="lineno">  365</span>    {</div>
<div class="line"><a id="l00366" name="l00366"></a><span class="lineno">  366</span>        LCD-&gt;L[lcd_layer].LCR &amp;= ~(1 &lt;&lt; LCD_LCR_CKEN_Pos);</div>
<div class="line"><a id="l00367" name="l00367"></a><span class="lineno">  367</span> </div>
<div class="line"><a id="l00368" name="l00368"></a><span class="lineno">  368</span>        LCD-&gt;L[lcd_layer].CK = 0;</div>
<div class="line"><a id="l00369" name="l00369"></a><span class="lineno">  369</span>    }</div>
<div class="line"><a id="l00370" name="l00370"></a><span class="lineno">  370</span> </div>
<div class="line"><a id="l00371" name="l00371"></a><span class="lineno">  371</span>    LCD-&gt;CR |= (1 &lt;&lt; LCD_CR_VBPRELOAD_Pos); <span class="comment">// 1 帧显示开始时，将层配置寄存器的值加载到层工作寄存器中</span></div>
<div class="line"><a id="l00372" name="l00372"></a><span class="lineno">  372</span>}</div>
<div class="line"><a id="l00373" name="l00373"></a><span class="lineno">  373</span> </div>
<div class="line"><a id="l00381" name="l00381"></a><span class="lineno"><a class="line" href="load__mv_8c.html#a26fdaf5976717811bbc2342599b1da4b">  381</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="load__mv_8c.html#a26fdaf5976717811bbc2342599b1da4b">video_outset_format</a>(uint8_t format, uint8_t rgb565_dither)</div>
<div class="line"><a id="l00382" name="l00382"></a><span class="lineno">  382</span>{</div>
<div class="line"><a id="l00383" name="l00383"></a><span class="lineno">  383</span>    <a class="code hl_variable" href="load__mv_8c.html#acc289e18199098eb1e60099e71ce5476">Video_OutSet</a>.format = format;</div>
<div class="line"><a id="l00384" name="l00384"></a><span class="lineno">  384</span>    <a class="code hl_variable" href="load__mv_8c.html#acc289e18199098eb1e60099e71ce5476">Video_OutSet</a>.dither = (JPEG_OUT_RGB565 == format) ? rgb565_dither : 0; <span class="comment">// RGB565 dithering enable</span></div>
<div class="line"><a id="l00385" name="l00385"></a><span class="lineno">  385</span>}</div>
<div class="line"><a id="l00386" name="l00386"></a><span class="lineno">  386</span> </div>
<div class="line"><a id="l00395" name="l00395"></a><span class="lineno"><a class="line" href="load__mv_8c.html#a319fc11a86458ae8f312ba52f686483c">  395</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="load__mv_8c.html#a319fc11a86458ae8f312ba52f686483c">video_set_post</a>(<a class="code hl_enumeration" href="load__mv_8h.html#ab9806189ae8983878b4853db01912f47">lcd_layer_t</a> lcd_layer, uint16_t xs, uint16_t ys)</div>
<div class="line"><a id="l00396" name="l00396"></a><span class="lineno">  396</span>{</div>
<div class="line"><a id="l00397" name="l00397"></a><span class="lineno">  397</span>    <span class="comment">// 参数校验</span></div>
<div class="line"><a id="l00398" name="l00398"></a><span class="lineno">  398</span>    <span class="keywordflow">if</span> (xs &gt;= (<a class="code hl_define" href="version_8h.html#a23a8c652045ed1831883b0c6785bea16">LCD_HDOT</a> - 1) || ys &gt;= (<a class="code hl_define" href="version_8h.html#a13286deaebfd1c39a4e3638e8718c274">LCD_VDOT</a> - 1))</div>
<div class="line"><a id="l00399" name="l00399"></a><span class="lineno">  399</span>    {</div>
<div class="line"><a id="l00400" name="l00400"></a><span class="lineno">  400</span>        <a class="code hl_define" href="load__mv_8c.html#abd1e47f634a69dfe15a08cf0ca6219b0">MV_LOG</a>(<span class="stringliteral">&quot;[assert] xs = [%d], ys = [%d]\r\n&quot;</span>, xs, ys);</div>
<div class="line"><a id="l00401" name="l00401"></a><span class="lineno">  401</span>        <span class="keywordflow">return</span>; <span class="comment">// 错误抛出 assert</span></div>
<div class="line"><a id="l00402" name="l00402"></a><span class="lineno">  402</span>    }</div>
<div class="line"><a id="l00403" name="l00403"></a><span class="lineno">  403</span> </div>
<div class="line"><a id="l00404" name="l00404"></a><span class="lineno">  404</span>    uint16_t xe = 0, ye = 0; <span class="comment">// 终止位置（包含），不得小于 起始位置，且 HStop - HStart 结果必须为奇数</span></div>
<div class="line"><a id="l00405" name="l00405"></a><span class="lineno">  405</span> </div>
<div class="line"><a id="l00406" name="l00406"></a><span class="lineno">  406</span>    <span class="comment">// 检查 Avix 是否有效</span></div>
<div class="line"><a id="l00407" name="l00407"></a><span class="lineno">  407</span>    <span class="keywordflow">if</span> (<a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>.<a class="code hl_variable" href="struct_a_v_i___i_n_f_o.html#ad672690f555bb08866a491753109e551">Width</a> &gt; 0 &amp;&amp; <a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>.<a class="code hl_variable" href="struct_a_v_i___i_n_f_o.html#a3bdc883455d9732f65c9d4cb1aebe28b">Height</a> &gt; 0)</div>
<div class="line"><a id="l00408" name="l00408"></a><span class="lineno">  408</span>    {</div>
<div class="line"><a id="l00409" name="l00409"></a><span class="lineno">  409</span>        <span class="comment">// 图层大小自适应视频源</span></div>
<div class="line"><a id="l00410" name="l00410"></a><span class="lineno">  410</span>        xe = ((xs + <a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>.<a class="code hl_variable" href="struct_a_v_i___i_n_f_o.html#ad672690f555bb08866a491753109e551">Width</a> - 1) &gt; (<a class="code hl_define" href="version_8h.html#a23a8c652045ed1831883b0c6785bea16">LCD_HDOT</a> - 1)) ? (<a class="code hl_define" href="version_8h.html#a23a8c652045ed1831883b0c6785bea16">LCD_HDOT</a> - 1) : (xs + <a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>.<a class="code hl_variable" href="struct_a_v_i___i_n_f_o.html#ad672690f555bb08866a491753109e551">Width</a> - 1);</div>
<div class="line"><a id="l00411" name="l00411"></a><span class="lineno">  411</span>        ye = ((ys + <a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>.<a class="code hl_variable" href="struct_a_v_i___i_n_f_o.html#a3bdc883455d9732f65c9d4cb1aebe28b">Height</a> - 1) &gt; (<a class="code hl_define" href="version_8h.html#a13286deaebfd1c39a4e3638e8718c274">LCD_VDOT</a> - 1)) ? (<a class="code hl_define" href="version_8h.html#a13286deaebfd1c39a4e3638e8718c274">LCD_VDOT</a> - 1) : (ys + <a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>.<a class="code hl_variable" href="struct_a_v_i___i_n_f_o.html#a3bdc883455d9732f65c9d4cb1aebe28b">Height</a> - 1);</div>
<div class="line"><a id="l00412" name="l00412"></a><span class="lineno">  412</span> </div>
<div class="line"><a id="l00413" name="l00413"></a><span class="lineno">  413</span>        <span class="keywordflow">if</span> (((xe - xs) &amp; 0x1) == 0) <span class="comment">// 每行像素点数必须为偶数, 而 0 表示 1 个像素点, 故 差 必须为奇数</span></div>
<div class="line"><a id="l00414" name="l00414"></a><span class="lineno">  414</span>        {</div>
<div class="line"><a id="l00415" name="l00415"></a><span class="lineno">  415</span>            <span class="keywordflow">if</span> (xe &lt; <a class="code hl_define" href="version_8h.html#a23a8c652045ed1831883b0c6785bea16">LCD_HDOT</a> - 1) <span class="comment">// 变更奇偶性-优先改变 xe</span></div>
<div class="line"><a id="l00416" name="l00416"></a><span class="lineno">  416</span>                xe += 1;</div>
<div class="line"><a id="l00417" name="l00417"></a><span class="lineno">  417</span>            <span class="keywordflow">else</span> <span class="keywordflow">if</span> (xs &gt; 0)</div>
<div class="line"><a id="l00418" name="l00418"></a><span class="lineno">  418</span>                xs -= 1;</div>
<div class="line"><a id="l00419" name="l00419"></a><span class="lineno">  419</span>            <span class="keywordflow">else</span></div>
<div class="line"><a id="l00420" name="l00420"></a><span class="lineno">  420</span>                <span class="keywordflow">return</span>;</div>
<div class="line"><a id="l00421" name="l00421"></a><span class="lineno">  421</span>        }</div>
<div class="line"><a id="l00422" name="l00422"></a><span class="lineno">  422</span>        LCD_SetLayerPos(LCD, lcd_layer, xs, xe, ys, ye);</div>
<div class="line"><a id="l00423" name="l00423"></a><span class="lineno">  423</span>    }</div>
<div class="line"><a id="l00424" name="l00424"></a><span class="lineno">  424</span>}</div>
<div class="line"><a id="l00425" name="l00425"></a><span class="lineno">  425</span> </div>
<div class="line"><a id="l00431" name="l00431"></a><span class="lineno"><a class="line" href="load__mv_8c.html#a3ff08970bdf7f8e28122786eac11d6d3">  431</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="load__mv_8c.html#a3ff08970bdf7f8e28122786eac11d6d3">video_set_loop</a>(<span class="keyword">const</span> uint32_t times, <span class="keyword">const</span> uint32_t max)</div>
<div class="line"><a id="l00432" name="l00432"></a><span class="lineno">  432</span>{</div>
<div class="line"><a id="l00433" name="l00433"></a><span class="lineno">  433</span>    <a class="code hl_variable" href="load__mv_8c.html#a47fdfbb31eda448a7ec364e2e724c2b7">Video_Loop_Nums</a> = times;</div>
<div class="line"><a id="l00434" name="l00434"></a><span class="lineno">  434</span>    <a class="code hl_variable" href="load__mv_8c.html#adc415ff7c829fa6c6a78755deccbc10d">Video_Loop_Max</a> = max;</div>
<div class="line"><a id="l00435" name="l00435"></a><span class="lineno">  435</span>}</div>
<div class="line"><a id="l00436" name="l00436"></a><span class="lineno">  436</span> </div>
<div class="line"><a id="l00442" name="l00442"></a><span class="lineno"><a class="line" href="load__mv_8c.html#abe5464036c09e633ce1a409d40e11164">  442</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="load__mv_8c.html#abe5464036c09e633ce1a409d40e11164">video_get_loop</a>(uint32_t *times, uint32_t *max)</div>
<div class="line"><a id="l00443" name="l00443"></a><span class="lineno">  443</span>{</div>
<div class="line"><a id="l00444" name="l00444"></a><span class="lineno">  444</span>    <span class="keywordflow">if</span> (NULL != times)</div>
<div class="line"><a id="l00445" name="l00445"></a><span class="lineno">  445</span>        *times = <a class="code hl_variable" href="load__mv_8c.html#a47fdfbb31eda448a7ec364e2e724c2b7">Video_Loop_Nums</a>;</div>
<div class="line"><a id="l00446" name="l00446"></a><span class="lineno">  446</span> </div>
<div class="line"><a id="l00447" name="l00447"></a><span class="lineno">  447</span>    <span class="keywordflow">if</span> (NULL != max)</div>
<div class="line"><a id="l00448" name="l00448"></a><span class="lineno">  448</span>        *max = <a class="code hl_variable" href="load__mv_8c.html#adc415ff7c829fa6c6a78755deccbc10d">Video_Loop_Max</a>;</div>
<div class="line"><a id="l00449" name="l00449"></a><span class="lineno">  449</span>}</div>
<div class="line"><a id="l00450" name="l00450"></a><span class="lineno">  450</span> </div>
<div class="line"><a id="l00458" name="l00458"></a><span class="lineno"><a class="line" href="load__mv_8c.html#ab3b1a7d6c03074968fcdfa784fe8fe14">  458</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="load__mv_8c.html#ab3b1a7d6c03074968fcdfa784fe8fe14">video_center_with_tp</a>(uint16_t x, uint16_t y)</div>
<div class="line"><a id="l00459" name="l00459"></a><span class="lineno">  459</span>{</div>
<div class="line"><a id="l00460" name="l00460"></a><span class="lineno">  460</span>    <span class="comment">// 获取视频中心</span></div>
<div class="line"><a id="l00461" name="l00461"></a><span class="lineno">  461</span>    uint16_t video_center_x = (<a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>.<a class="code hl_variable" href="struct_a_v_i___i_n_f_o.html#ad672690f555bb08866a491753109e551">Width</a> &gt;&gt; 1) + (<a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>.<a class="code hl_variable" href="struct_a_v_i___i_n_f_o.html#ad672690f555bb08866a491753109e551">Width</a> &amp; 0b1);</div>
<div class="line"><a id="l00462" name="l00462"></a><span class="lineno">  462</span>    uint16_t video_center_y = (<a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>.<a class="code hl_variable" href="struct_a_v_i___i_n_f_o.html#a3bdc883455d9732f65c9d4cb1aebe28b">Height</a> &gt;&gt; 1) + (<a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>.<a class="code hl_variable" href="struct_a_v_i___i_n_f_o.html#a3bdc883455d9732f65c9d4cb1aebe28b">Height</a> &amp; 0b1);</div>
<div class="line"><a id="l00463" name="l00463"></a><span class="lineno">  463</span> </div>
<div class="line"><a id="l00464" name="l00464"></a><span class="lineno">  464</span>    <span class="comment">// 边界碰撞处理</span></div>
<div class="line"><a id="l00465" name="l00465"></a><span class="lineno">  465</span>    uint16_t xs = (x &lt; video_center_x) ? <span class="comment">/*video_center_x*/</span> 0 : x - video_center_x; <span class="comment">// left</span></div>
<div class="line"><a id="l00466" name="l00466"></a><span class="lineno">  466</span>    xs = (x &gt; <a class="code hl_define" href="version_8h.html#a23a8c652045ed1831883b0c6785bea16">LCD_HDOT</a> - video_center_x) ? (<a class="code hl_define" href="version_8h.html#a23a8c652045ed1831883b0c6785bea16">LCD_HDOT</a> - video_center_x * 2) : xs;</div>
<div class="line"><a id="l00467" name="l00467"></a><span class="lineno">  467</span>    <span class="comment">// uint16_t xe = (x &gt; LCD_HDOT - video_center_x) ? (LCD_HDOT - video_center_x * 2) : x;// right</span></div>
<div class="line"><a id="l00468" name="l00468"></a><span class="lineno">  468</span> </div>
<div class="line"><a id="l00469" name="l00469"></a><span class="lineno">  469</span>    uint16_t ys = (y &lt; video_center_y) ? <span class="comment">/*video_center_y*/</span> 0 : y - video_center_y; <span class="comment">// up</span></div>
<div class="line"><a id="l00470" name="l00470"></a><span class="lineno">  470</span>    ys = (y &gt; <a class="code hl_define" href="version_8h.html#a13286deaebfd1c39a4e3638e8718c274">LCD_VDOT</a> - video_center_y) ? (<a class="code hl_define" href="version_8h.html#a13286deaebfd1c39a4e3638e8718c274">LCD_VDOT</a> - video_center_y * 2) : ys;</div>
<div class="line"><a id="l00471" name="l00471"></a><span class="lineno">  471</span>    <span class="comment">// uint16_t ye = (y &gt; LCD_VDOT - video_center_y) ? (LCD_VDOT - video_center_y * 2) : y;// down</span></div>
<div class="line"><a id="l00472" name="l00472"></a><span class="lineno">  472</span> </div>
<div class="line"><a id="l00473" name="l00473"></a><span class="lineno">  473</span>    <a class="code hl_function" href="load__mv_8c.html#a319fc11a86458ae8f312ba52f686483c">video_set_post</a>(<a class="code hl_enumvalue" href="load__mv_8h.html#ab9806189ae8983878b4853db01912f47a385d7e8b722132d2e22f31b06e30be97">LAYER_2_VIDEO</a>, xs, ys);</div>
<div class="line"><a id="l00474" name="l00474"></a><span class="lineno">  474</span>}</div>
<div class="line"><a id="l00475" name="l00475"></a><span class="lineno">  475</span> </div>
<div class="line"><a id="l00476" name="l00476"></a><span class="lineno">  476</span><span class="comment">//-----------------------------------------------本地函数定义------------------------------------------------//</span></div>
<div class="line"><a id="l00482" name="l00482"></a><span class="lineno"><a class="line" href="load__mv_8c.html#a978ed993bd878f76db92c810771c0ee8">  482</a></span><span class="comment"></span><span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code hl_function" href="load__mv_8c.html#a978ed993bd878f76db92c810771c0ee8">cb_close_avi</a>(<span class="keywordtype">void</span> *data)</div>
<div class="line"><a id="l00483" name="l00483"></a><span class="lineno">  483</span>{</div>
<div class="line"><a id="l00484" name="l00484"></a><span class="lineno">  484</span>    <span class="keywordflow">if</span> (<a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>.<a class="code hl_variable" href="struct_a_v_i___i_n_f_o.html#ae256ff66a407ed8f0a929b4159c91871">AudioBufSize</a> &gt; 0) <span class="comment">// 视频有音轨</span></div>
<div class="line"><a id="l00485" name="l00485"></a><span class="lineno">  485</span>    {</div>
<div class="line"><a id="l00486" name="l00486"></a><span class="lineno">  486</span>        <a class="code hl_function" href="dev__dac_8c.html#a7274a6adbc1a4a9f5a2f27be8d1225e4">dac_dma_deinit</a>();</div>
<div class="line"><a id="l00487" name="l00487"></a><span class="lineno">  487</span>    }</div>
<div class="line"><a id="l00488" name="l00488"></a><span class="lineno">  488</span>    TIMR_Stop(<a class="code hl_define" href="load__mv_8c.html#a35c6cf21059ba899b846d63b5224dc54">TIMR_AVI</a>);</div>
<div class="line"><a id="l00489" name="l00489"></a><span class="lineno">  489</span> </div>
<div class="line"><a id="l00490" name="l00490"></a><span class="lineno">  490</span>    f_close(&amp;<a class="code hl_variable" href="load__mv_8c.html#a4dad906d6569beca6b524a122e5ebb11">File_Handle</a>);</div>
<div class="line"><a id="l00491" name="l00491"></a><span class="lineno">  491</span> </div>
<div class="line"><a id="l00492" name="l00492"></a><span class="lineno">  492</span>    uint32_t free_ptr = LCD-&gt;L[<a class="code hl_enumvalue" href="load__mv_8h.html#ab9806189ae8983878b4853db01912f47a007207a8bae3c327ad4531fa3e5fac93">LAYER_1_GUI</a>].ADDR;</div>
<div class="line"><a id="l00493" name="l00493"></a><span class="lineno">  493</span>    <span class="keywordflow">if</span> (((LCD-&gt;L[<a class="code hl_enumvalue" href="load__mv_8h.html#ab9806189ae8983878b4853db01912f47a385d7e8b722132d2e22f31b06e30be97">LAYER_2_VIDEO</a>].LCR) &gt;&gt; LCD_LCR_EN_Pos) != 0) <span class="comment">// 判断第 2 图层是否被优先使用(与 parser avi() 策略对应)</span></div>
<div class="line"><a id="l00494" name="l00494"></a><span class="lineno">  494</span>    {</div>
<div class="line"><a id="l00495" name="l00495"></a><span class="lineno">  495</span>        LCD-&gt;L[<a class="code hl_enumvalue" href="load__mv_8h.html#ab9806189ae8983878b4853db01912f47a385d7e8b722132d2e22f31b06e30be97">LAYER_2_VIDEO</a>].LCR &amp;= ~(1 &lt;&lt; LCD_LCR_EN_Pos); <span class="comment">// 配置 LCD 第 2 图层 失能</span></div>
<div class="line"><a id="l00496" name="l00496"></a><span class="lineno">  496</span>        LCD-&gt;CR |= (1 &lt;&lt; LCD_CR_VBPRELOAD_Pos);              <span class="comment">// 1 帧显示开始时，将层配置寄存器的值加载到层工作寄存器中</span></div>
<div class="line"><a id="l00497" name="l00497"></a><span class="lineno">  497</span>        free_ptr = LCD-&gt;L[<a class="code hl_enumvalue" href="load__mv_8h.html#ab9806189ae8983878b4853db01912f47a385d7e8b722132d2e22f31b06e30be97">LAYER_2_VIDEO</a>].ADDR;</div>
<div class="line"><a id="l00498" name="l00498"></a><span class="lineno">  498</span>    }</div>
<div class="line"><a id="l00499" name="l00499"></a><span class="lineno">  499</span> </div>
<div class="line"><a id="l00500" name="l00500"></a><span class="lineno">  500</span>    <a class="code hl_define" href="load__mv_8c.html#abd1e47f634a69dfe15a08cf0ca6219b0">MV_LOG</a>(<span class="stringliteral">&quot;[sdram_free] [Video_OutSet_Ptr] = 0x[%x], &quot;</span>, free_ptr);</div>
<div class="line"><a id="l00501" name="l00501"></a><span class="lineno">  501</span>    <span class="keywordflow">if</span> (0 != <a class="code hl_function" href="mem__sdram_8c.html#a9ef7e7053d4000fe99a7eacc8d9346d7">sdram_free</a>((<span class="keywordtype">void</span> *)free_ptr))</div>
<div class="line"><a id="l00502" name="l00502"></a><span class="lineno">  502</span>    {</div>
<div class="line"><a id="l00503" name="l00503"></a><span class="lineno">  503</span>        free_ptr = NULL;</div>
<div class="line"><a id="l00504" name="l00504"></a><span class="lineno">  504</span>        <a class="code hl_define" href="load__mv_8c.html#abd1e47f634a69dfe15a08cf0ca6219b0">MV_LOG</a>(<span class="stringliteral">&quot;[sdram_free] [Video_OutSet_Ptr] = Fail&quot;</span>);</div>
<div class="line"><a id="l00505" name="l00505"></a><span class="lineno">  505</span>    }</div>
<div class="line"><a id="l00506" name="l00506"></a><span class="lineno">  506</span>    <a class="code hl_define" href="load__mv_8c.html#abd1e47f634a69dfe15a08cf0ca6219b0">MV_LOG</a>(<span class="stringliteral">&quot;sdram_free_size = [%d]\r\n&quot;</span>, <a class="code hl_function" href="mem__sdram_8c.html#a5518679ba96822661667b2b3d5182379">sdram_get_idle_size</a>());</div>
<div class="line"><a id="l00507" name="l00507"></a><span class="lineno">  507</span> </div>
<div class="line"><a id="l00508" name="l00508"></a><span class="lineno">  508</span>    memset(&amp;<a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>, 0, <span class="keyword">sizeof</span>(<a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>));</div>
<div class="line"><a id="l00509" name="l00509"></a><span class="lineno">  509</span> </div>
<div class="line"><a id="l00510" name="l00510"></a><span class="lineno">  510</span>    <a class="code hl_define" href="load__mv_8c.html#abd1e47f634a69dfe15a08cf0ca6219b0">MV_LOG</a>(<span class="stringliteral">&quot;stream loop nums = [%d], Max_times = [%d]\r\n&quot;</span>, <a class="code hl_variable" href="load__mv_8c.html#a47fdfbb31eda448a7ec364e2e724c2b7">Video_Loop_Nums</a>, <a class="code hl_variable" href="load__mv_8c.html#adc415ff7c829fa6c6a78755deccbc10d">Video_Loop_Max</a>);</div>
<div class="line"><a id="l00511" name="l00511"></a><span class="lineno">  511</span>    <a class="code hl_variable" href="load__mv_8c.html#a47fdfbb31eda448a7ec364e2e724c2b7">Video_Loop_Nums</a> = 0; <span class="comment">// 清零循环播放计数值, 对于每个视频都是从零开始</span></div>
<div class="line"><a id="l00512" name="l00512"></a><span class="lineno">  512</span> </div>
<div class="line"><a id="l00513" name="l00513"></a><span class="lineno">  513</span>    <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="load__mv_8c.html#aefd70b8b91d72cbd548b6c38f385983bab470eb20dd049d7bdce38bc9ae5f0db1">fsm_state_idle</a>;</div>
<div class="line"><a id="l00514" name="l00514"></a><span class="lineno">  514</span>}</div>
<div class="line"><a id="l00515" name="l00515"></a><span class="lineno">  515</span> </div>
<div class="line"><a id="l00521" name="l00521"></a><span class="lineno"><a class="line" href="load__mv_8c.html#a79e1ebe637dcb48c69706eb81c73b576">  521</a></span><span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code hl_function" href="load__mv_8c.html#a79e1ebe637dcb48c69706eb81c73b576">cb_close_wav</a>(<span class="keywordtype">void</span> *data)</div>
<div class="line"><a id="l00522" name="l00522"></a><span class="lineno">  522</span>{</div>
<div class="line"><a id="l00523" name="l00523"></a><span class="lineno">  523</span>    <a class="code hl_function" href="dev__dac_8c.html#a7274a6adbc1a4a9f5a2f27be8d1225e4">dac_dma_deinit</a>();</div>
<div class="line"><a id="l00524" name="l00524"></a><span class="lineno">  524</span>    f_close(&amp;<a class="code hl_variable" href="load__mv_8c.html#a4dad906d6569beca6b524a122e5ebb11">File_Handle</a>);</div>
<div class="line"><a id="l00525" name="l00525"></a><span class="lineno">  525</span>    <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="load__mv_8c.html#aefd70b8b91d72cbd548b6c38f385983bab470eb20dd049d7bdce38bc9ae5f0db1">fsm_state_idle</a>;</div>
<div class="line"><a id="l00526" name="l00526"></a><span class="lineno">  526</span>}</div>
<div class="line"><a id="l00527" name="l00527"></a><span class="lineno">  527</span> </div>
<div class="line"><a id="l00533" name="l00533"></a><span class="lineno"><a class="line" href="load__mv_8c.html#a904f1d788d926c7864c948c4f9d1c66f">  533</a></span><span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code hl_function" href="load__mv_8c.html#a904f1d788d926c7864c948c4f9d1c66f">cb_parser_avi</a>(<span class="keywordtype">void</span> *data)</div>
<div class="line"><a id="l00534" name="l00534"></a><span class="lineno">  534</span>{</div>
<div class="line"><a id="l00535" name="l00535"></a><span class="lineno">  535</span>    <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> file_path = data;</div>
<div class="line"><a id="l00536" name="l00536"></a><span class="lineno">  536</span>    FRESULT f_res = FR_OK;</div>
<div class="line"><a id="l00537" name="l00537"></a><span class="lineno">  537</span>    <a class="code hl_enumeration" href="avi__parser_8h.html#a5fb6196ec8881cca7d4205dff28d5bb7">AVISTATUS</a> avi_res = <a class="code hl_enumvalue" href="avi__parser_8h.html#a5fb6196ec8881cca7d4205dff28d5bb7a55b5c2e0d0717e8a2ee2d4d83c04d74e">AVI_OK</a>;</div>
<div class="line"><a id="l00538" name="l00538"></a><span class="lineno">  538</span>    uint32_t read_len = 0;</div>
<div class="line"><a id="l00539" name="l00539"></a><span class="lineno">  539</span>    <span class="keywordtype">void</span> *video_frame_ptr = <a class="code hl_variable" href="dev__jpeg_8c.html#a134ecf44573e0f7204be01b09c1e48bb">JPEG_Decoder_Buff</a>;</div>
<div class="line"><a id="l00540" name="l00540"></a><span class="lineno">  540</span> </div>
<div class="line"><a id="l00541" name="l00541"></a><span class="lineno">  541</span>    uint32_t video_frame_size = <a class="code hl_define" href="version_8h.html#a23a8c652045ed1831883b0c6785bea16">LCD_HDOT</a> * <a class="code hl_define" href="version_8h.html#a13286deaebfd1c39a4e3638e8718c274">LCD_VDOT</a> * <a class="code hl_define" href="version_8h.html#ae3f7a8bd03ba0b575f7ece837aab91aa">LCD_FMT</a>;</div>
<div class="line"><a id="l00542" name="l00542"></a><span class="lineno">  542</span> </div>
<div class="line"><a id="l00543" name="l00543"></a><span class="lineno">  543</span><span class="comment">// 480*480 个别视频第一帧视频 Avix 头信息在大于一帧长度后面,故此处多读一些, 以保证 avi_init() 正确解析 Avix 头</span></div>
<div class="line"><a id="l00544" name="l00544"></a><span class="lineno">  544</span><span class="preprocessor">#if (LCD_HDOT == 480 &amp;&amp; LCD_VDOT == 480)</span></div>
<div class="line"><a id="l00545" name="l00545"></a><span class="lineno">  545</span>    video_frame_size = <span class="keyword">sizeof</span>(<a class="code hl_variable" href="dev__jpeg_8c.html#a134ecf44573e0f7204be01b09c1e48bb">JPEG_Decoder_Buff</a>) / 4 * 5;</div>
<div class="line"><a id="l00546" name="l00546"></a><span class="lineno">  546</span>    video_frame_ptr = <a class="code hl_function" href="mem__sdram_8c.html#ae1630464a6d7686e9e41daf4b38e74a8">sdram_malloc</a>(video_frame_size); <span class="comment">// 分配临时读取视频第一帧的缓存, 稍后解析完 Avix 头便释放</span></div>
<div class="line"><a id="l00547" name="l00547"></a><span class="lineno">  547</span> </div>
<div class="line"><a id="l00548" name="l00548"></a><span class="lineno">  548</span>    <a class="code hl_define" href="load__mv_8c.html#abd1e47f634a69dfe15a08cf0ca6219b0">MV_LOG</a>(<span class="stringliteral">&quot;[%s] file [sdram_malloc] [video_frame_ptr] = 0x[%p], size = [%d], sdram_free_size = [%d]\r\n&quot;</span>,</div>
<div class="line"><a id="l00549" name="l00549"></a><span class="lineno">  549</span>           file_path, video_frame_ptr, video_frame_size, <a class="code hl_function" href="mem__sdram_8c.html#a5518679ba96822661667b2b3d5182379">sdram_get_idle_size</a>());</div>
<div class="line"><a id="l00550" name="l00550"></a><span class="lineno">  550</span>    <span class="keywordflow">if</span> (NULL == video_frame_ptr)</div>
<div class="line"><a id="l00551" name="l00551"></a><span class="lineno">  551</span>    {</div>
<div class="line"><a id="l00552" name="l00552"></a><span class="lineno">  552</span>        <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="load__mv_8c.html#aefd70b8b91d72cbd548b6c38f385983bab470eb20dd049d7bdce38bc9ae5f0db1">fsm_state_idle</a>;</div>
<div class="line"><a id="l00553" name="l00553"></a><span class="lineno">  553</span>    }</div>
<div class="line"><a id="l00554" name="l00554"></a><span class="lineno">  554</span><span class="preprocessor">#endif </span><span class="comment">//(LCD_HDOT == 480 &amp;&amp; LCD_VDOT == 480)</span></div>
<div class="line"><a id="l00555" name="l00555"></a><span class="lineno">  555</span> </div>
<div class="line"><a id="l00556" name="l00556"></a><span class="lineno">  556</span>    <span class="comment">// 打开文件</span></div>
<div class="line"><a id="l00557" name="l00557"></a><span class="lineno">  557</span>    f_res = f_open(&amp;<a class="code hl_variable" href="load__mv_8c.html#a4dad906d6569beca6b524a122e5ebb11">File_Handle</a>, file_path, FA_READ | FA_OPEN_EXISTING);</div>
<div class="line"><a id="l00558" name="l00558"></a><span class="lineno">  558</span>    <span class="keywordflow">if</span> (FR_OK != f_res)</div>
<div class="line"><a id="l00559" name="l00559"></a><span class="lineno">  559</span>    {</div>
<div class="line"><a id="l00560" name="l00560"></a><span class="lineno">  560</span>        <a class="code hl_define" href="load__mv_8c.html#abd1e47f634a69dfe15a08cf0ca6219b0">MV_LOG</a>(<span class="stringliteral">&quot;[%s] file [f_open] result = [%s]\r\n&quot;</span>, file_path, <a class="code hl_variable" href="load__mv_8c.html#a158fc3faa30ddbece4360f3114710212">Debug_FR_Table</a>[f_res]);</div>
<div class="line"><a id="l00561" name="l00561"></a><span class="lineno">  561</span>        <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="load__mv_8c.html#aefd70b8b91d72cbd548b6c38f385983bab470eb20dd049d7bdce38bc9ae5f0db1">fsm_state_idle</a>;</div>
<div class="line"><a id="l00562" name="l00562"></a><span class="lineno">  562</span>    }</div>
<div class="line"><a id="l00563" name="l00563"></a><span class="lineno">  563</span>    <span class="comment">// 读取 AVI 文件头</span></div>
<div class="line"><a id="l00564" name="l00564"></a><span class="lineno">  564</span>    f_res = f_read(&amp;<a class="code hl_variable" href="load__mv_8c.html#a4dad906d6569beca6b524a122e5ebb11">File_Handle</a>, video_frame_ptr, video_frame_size, &amp;read_len);</div>
<div class="line"><a id="l00565" name="l00565"></a><span class="lineno">  565</span>    <span class="keywordflow">if</span> (FR_OK != f_res || 0 == read_len)</div>
<div class="line"><a id="l00566" name="l00566"></a><span class="lineno">  566</span>    {</div>
<div class="line"><a id="l00567" name="l00567"></a><span class="lineno">  567</span>        <a class="code hl_define" href="load__mv_8c.html#abd1e47f634a69dfe15a08cf0ca6219b0">MV_LOG</a>(<span class="stringliteral">&quot;[%s] file [f_read] read_len = [%d], result = [%s]\r\n&quot;</span>, file_path, read_len, <a class="code hl_variable" href="load__mv_8c.html#a158fc3faa30ddbece4360f3114710212">Debug_FR_Table</a>[f_res]);</div>
<div class="line"><a id="l00568" name="l00568"></a><span class="lineno">  568</span>        <span class="keywordflow">goto</span> error_parser_avi;</div>
<div class="line"><a id="l00569" name="l00569"></a><span class="lineno">  569</span>    }</div>
<div class="line"><a id="l00570" name="l00570"></a><span class="lineno">  570</span>    <span class="comment">// 对 AVI 文件头进行解析</span></div>
<div class="line"><a id="l00571" name="l00571"></a><span class="lineno">  571</span>    avi_res = <a class="code hl_function" href="avi__parser_8c.html#ab72d5be5e6149cfe3dc314d99f5b11c2">avi_init</a>((uint8_t *)video_frame_ptr, read_len);</div>
<div class="line"><a id="l00572" name="l00572"></a><span class="lineno">  572</span>    <span class="keywordflow">if</span> (<a class="code hl_enumvalue" href="avi__parser_8h.html#a5fb6196ec8881cca7d4205dff28d5bb7a55b5c2e0d0717e8a2ee2d4d83c04d74e">AVI_OK</a> != avi_res)</div>
<div class="line"><a id="l00573" name="l00573"></a><span class="lineno">  573</span>    {</div>
<div class="line"><a id="l00574" name="l00574"></a><span class="lineno">  574</span>        <a class="code hl_define" href="load__mv_8c.html#abd1e47f634a69dfe15a08cf0ca6219b0">MV_LOG</a>(<span class="stringliteral">&quot;[%s] file [avi_init] result error[%d], read_len = [%d]\r\n&quot;</span>, file_path, avi_res, read_len);</div>
<div class="line"><a id="l00575" name="l00575"></a><span class="lineno">  575</span>        <span class="keywordflow">goto</span> error_parser_avi;</div>
<div class="line"><a id="l00576" name="l00576"></a><span class="lineno">  576</span>    }</div>
<div class="line"><a id="l00577" name="l00577"></a><span class="lineno">  577</span>    <span class="comment">// 寻找 movi ID</span></div>
<div class="line"><a id="l00578" name="l00578"></a><span class="lineno">  578</span>    <a class="code hl_variable" href="load__mv_8c.html#a466f231c4630e48f95aa5980f6d0cc42">Restart_Offset</a> = <a class="code hl_function" href="avi__parser_8c.html#a56b444192eb7b54acf7dcac7829e4f45">avi_srarch_id</a>((uint8_t *)video_frame_ptr, read_len, <span class="stringliteral">&quot;movi&quot;</span>);</div>
<div class="line"><a id="l00579" name="l00579"></a><span class="lineno">  579</span>    <span class="keywordflow">if</span> (0 == <a class="code hl_variable" href="load__mv_8c.html#a466f231c4630e48f95aa5980f6d0cc42">Restart_Offset</a>)</div>
<div class="line"><a id="l00580" name="l00580"></a><span class="lineno">  580</span>    {</div>
<div class="line"><a id="l00581" name="l00581"></a><span class="lineno">  581</span>        <a class="code hl_define" href="load__mv_8c.html#abd1e47f634a69dfe15a08cf0ca6219b0">MV_LOG</a>(<span class="stringliteral">&quot;[%s] file [avi_srarch_id] result error, read_len = [%d]\r\n&quot;</span>, file_path, read_len);</div>
<div class="line"><a id="l00582" name="l00582"></a><span class="lineno">  582</span>        <span class="keywordflow">goto</span> error_parser_avi;</div>
<div class="line"><a id="l00583" name="l00583"></a><span class="lineno">  583</span>    }</div>
<div class="line"><a id="l00584" name="l00584"></a><span class="lineno">  584</span>    <span class="comment">// 获取第一帧信息</span></div>
<div class="line"><a id="l00585" name="l00585"></a><span class="lineno">  585</span>    avi_res = <a class="code hl_function" href="avi__parser_8c.html#a73b7c644cef0ac1324602e57006ba23c">avi_get_streaminfo</a>((uint8_t *)(video_frame_ptr + <a class="code hl_variable" href="load__mv_8c.html#a466f231c4630e48f95aa5980f6d0cc42">Restart_Offset</a> + 4));</div>
<div class="line"><a id="l00586" name="l00586"></a><span class="lineno">  586</span>    <span class="keywordflow">if</span> (<a class="code hl_enumvalue" href="avi__parser_8h.html#a5fb6196ec8881cca7d4205dff28d5bb7a55b5c2e0d0717e8a2ee2d4d83c04d74e">AVI_OK</a> != avi_res)</div>
<div class="line"><a id="l00587" name="l00587"></a><span class="lineno">  587</span>    {</div>
<div class="line"><a id="l00588" name="l00588"></a><span class="lineno">  588</span>        <a class="code hl_define" href="load__mv_8c.html#abd1e47f634a69dfe15a08cf0ca6219b0">MV_LOG</a>(<span class="stringliteral">&quot;[%s] file [avi_get_streaminfo] result error[%d]\r\n&quot;</span>, file_path, avi_res);</div>
<div class="line"><a id="l00589" name="l00589"></a><span class="lineno">  589</span>        <span class="keywordflow">goto</span> error_parser_avi;</div>
<div class="line"><a id="l00590" name="l00590"></a><span class="lineno">  590</span>    }</div>
<div class="line"><a id="l00591" name="l00591"></a><span class="lineno">  591</span>    <span class="comment">// 跳过标志ID,读地址偏移到流数据开始处</span></div>
<div class="line"><a id="l00592" name="l00592"></a><span class="lineno">  592</span>    f_lseek(&amp;<a class="code hl_variable" href="load__mv_8c.html#a4dad906d6569beca6b524a122e5ebb11">File_Handle</a>, <a class="code hl_variable" href="load__mv_8c.html#a466f231c4630e48f95aa5980f6d0cc42">Restart_Offset</a> + 12);</div>
<div class="line"><a id="l00593" name="l00593"></a><span class="lineno">  593</span> </div>
<div class="line"><a id="l00594" name="l00594"></a><span class="lineno">  594</span>    <span class="comment">// 保存播放时的起始信息，便于重新播放</span></div>
<div class="line"><a id="l00595" name="l00595"></a><span class="lineno">  595</span>    <a class="code hl_variable" href="load__mv_8c.html#a270fa9b5805fcc89bfb0c3f0bcf77c4d">Restart_Stream_ID</a> = <a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>.<a class="code hl_variable" href="struct_a_v_i___i_n_f_o.html#aebe839b9a64cd04e96f275be975f3661">StreamID</a>;</div>
<div class="line"><a id="l00596" name="l00596"></a><span class="lineno">  596</span>    <a class="code hl_variable" href="load__mv_8c.html#adf6b06c522e8f78610aa821eff3a2508">Restart_StreamSize</a> = <a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>.<a class="code hl_variable" href="struct_a_v_i___i_n_f_o.html#ae9f33841c7538c99150077f9c04d7070">StreamSize</a>;</div>
<div class="line"><a id="l00597" name="l00597"></a><span class="lineno">  597</span>    <a class="code hl_define" href="load__mv_8c.html#abd1e47f634a69dfe15a08cf0ca6219b0">MV_LOG</a>(<span class="stringliteral">&quot;fps:%d.\r\n&quot;</span>, 1000 / (<a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>.<a class="code hl_variable" href="struct_a_v_i___i_n_f_o.html#a780dbba77a0f21fe07b1facf6aba3dd3">SecPerFrame</a> / 1000));</div>
<div class="line"><a id="l00598" name="l00598"></a><span class="lineno">  598</span> </div>
<div class="line"><a id="l00599" name="l00599"></a><span class="lineno">  599</span><span class="preprocessor">#if (LCD_HDOT == 480 &amp;&amp; LCD_VDOT == 480)</span></div>
<div class="line"><a id="l00600" name="l00600"></a><span class="lineno">  600</span>    <a class="code hl_function" href="mem__sdram_8c.html#a9ef7e7053d4000fe99a7eacc8d9346d7">sdram_free</a>(video_frame_ptr); <span class="comment">// 释放临时读取视频第一帧的缓存</span></div>
<div class="line"><a id="l00601" name="l00601"></a><span class="lineno">  601</span>    <a class="code hl_define" href="load__mv_8c.html#abd1e47f634a69dfe15a08cf0ca6219b0">MV_LOG</a>(<span class="stringliteral">&quot;[%s] file [sdram_free] [video_frame_ptr] = 0x[%p], size = [%d], sdram_free_size = [%d]\r\n&quot;</span>,</div>
<div class="line"><a id="l00602" name="l00602"></a><span class="lineno">  602</span>           file_path, video_frame_ptr, video_frame_size, <a class="code hl_function" href="mem__sdram_8c.html#a5518679ba96822661667b2b3d5182379">sdram_get_idle_size</a>());</div>
<div class="line"><a id="l00603" name="l00603"></a><span class="lineno">  603</span>    video_frame_ptr = NULL;</div>
<div class="line"><a id="l00604" name="l00604"></a><span class="lineno">  604</span><span class="preprocessor">#endif </span><span class="comment">//(LCD_HDOT == 480 &amp;&amp; LCD_VDOT == 480)</span></div>
<div class="line"><a id="l00605" name="l00605"></a><span class="lineno">  605</span> </div>
<div class="line"><a id="l00606" name="l00606"></a><span class="lineno">  606</span>    <span class="comment">// 配置解码选项</span></div>
<div class="line"><a id="l00607" name="l00607"></a><span class="lineno">  607</span><span class="preprocessor">#if (LCD_FMT == LCD_RGB565)</span></div>
<div class="line"><a id="l00608" name="l00608"></a><span class="lineno">  608</span>    <a class="code hl_variable" href="load__mv_8c.html#acc289e18199098eb1e60099e71ce5476">Video_OutSet</a>.dither = 0; <span class="comment">// RGB565 dithering enable</span></div>
<div class="line"><a id="l00609" name="l00609"></a><span class="lineno">  609</span>    <a class="code hl_variable" href="load__mv_8c.html#acc289e18199098eb1e60099e71ce5476">Video_OutSet</a>.format = JPEG_OUT_RGB565;</div>
<div class="line"><a id="l00610" name="l00610"></a><span class="lineno">  610</span>    video_frame_size = <a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>.<a class="code hl_variable" href="struct_a_v_i___i_n_f_o.html#ad672690f555bb08866a491753109e551">Width</a> * <a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>.<a class="code hl_variable" href="struct_a_v_i___i_n_f_o.html#a3bdc883455d9732f65c9d4cb1aebe28b">Height</a> * <span class="keyword">sizeof</span>(uint16_t);</div>
<div class="line"><a id="l00611" name="l00611"></a><span class="lineno">  611</span><span class="preprocessor">#elif (LCD_FMT == LCD_ARGB888)</span></div>
<div class="line"><a id="l00612" name="l00612"></a><span class="lineno">  612</span>    <a class="code hl_variable" href="load__mv_8c.html#acc289e18199098eb1e60099e71ce5476">Video_OutSet</a>.dither = 0;</div>
<div class="line"><a id="l00613" name="l00613"></a><span class="lineno">  613</span>    <a class="code hl_variable" href="load__mv_8c.html#acc289e18199098eb1e60099e71ce5476">Video_OutSet</a>.format = JPEG_OUT_XRGB888;</div>
<div class="line"><a id="l00614" name="l00614"></a><span class="lineno">  614</span>    video_frame_size = <a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>.<a class="code hl_variable" href="struct_a_v_i___i_n_f_o.html#ad672690f555bb08866a491753109e551">Width</a> * <a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>.<a class="code hl_variable" href="struct_a_v_i___i_n_f_o.html#a3bdc883455d9732f65c9d4cb1aebe28b">Height</a> * <span class="keyword">sizeof</span>(uint32_t);</div>
<div class="line"><a id="l00615" name="l00615"></a><span class="lineno">  615</span><span class="preprocessor">#endif </span><span class="comment">// LCD_FORMAT</span></div>
<div class="line"><a id="l00616" name="l00616"></a><span class="lineno">  616</span> </div>
<div class="line"><a id="l00617" name="l00617"></a><span class="lineno">  617</span>    <span class="comment">// 配置视频帧解码输出区域</span></div>
<div class="line"><a id="l00618" name="l00618"></a><span class="lineno">  618</span>    <span class="keywordtype">void</span> *mem_ptr = <a class="code hl_function" href="mem__sdram_8c.html#ae1630464a6d7686e9e41daf4b38e74a8">sdram_malloc</a>(video_frame_size);</div>
<div class="line"><a id="l00619" name="l00619"></a><span class="lineno">  619</span>    <a class="code hl_define" href="load__mv_8c.html#abd1e47f634a69dfe15a08cf0ca6219b0">MV_LOG</a>(<span class="stringliteral">&quot;[%s] file [sdram_malloc] [Video_OutSet_Ptr] = 0x[%p], size = [%d], sdram_free_size = [%d]\r\n&quot;</span>,</div>
<div class="line"><a id="l00620" name="l00620"></a><span class="lineno">  620</span>           file_path, mem_ptr, video_frame_size, <a class="code hl_function" href="mem__sdram_8c.html#a5518679ba96822661667b2b3d5182379">sdram_get_idle_size</a>());</div>
<div class="line"><a id="l00621" name="l00621"></a><span class="lineno">  621</span>    <span class="keywordflow">if</span> (NULL == mem_ptr)</div>
<div class="line"><a id="l00622" name="l00622"></a><span class="lineno">  622</span>    {</div>
<div class="line"><a id="l00623" name="l00623"></a><span class="lineno">  623</span>        <span class="keywordflow">goto</span> error_parser_avi;</div>
<div class="line"><a id="l00624" name="l00624"></a><span class="lineno">  624</span>    }</div>
<div class="line"><a id="l00625" name="l00625"></a><span class="lineno">  625</span>    <a class="code hl_variable" href="load__mv_8c.html#acc289e18199098eb1e60099e71ce5476">Video_OutSet</a>.RGBAddr = (uint32_t)mem_ptr;</div>
<div class="line"><a id="l00626" name="l00626"></a><span class="lineno">  626</span>    memset(mem_ptr, 0x00, video_frame_size); <span class="comment">// 初始为黑色</span></div>
<div class="line"><a id="l00627" name="l00627"></a><span class="lineno">  627</span> </div>
<div class="line"><a id="l00628" name="l00628"></a><span class="lineno">  628</span>    <span class="comment">// 设定播放图层策略:</span></div>
<div class="line"><a id="l00629" name="l00629"></a><span class="lineno">  629</span>    <span class="comment">// 播放全屏视频时默认使用 LAYER_1_GUI 以避免大面积图层混合运算而导致绘图效率降低</span></div>
<div class="line"><a id="l00630" name="l00630"></a><span class="lineno">  630</span>    <span class="keywordflow">if</span> (<a class="code hl_define" href="version_8h.html#a23a8c652045ed1831883b0c6785bea16">LCD_HDOT</a> &lt;= <a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>.<a class="code hl_variable" href="struct_a_v_i___i_n_f_o.html#ad672690f555bb08866a491753109e551">Width</a> &amp;&amp; <a class="code hl_define" href="version_8h.html#a13286deaebfd1c39a4e3638e8718c274">LCD_VDOT</a> &lt;= <a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>.<a class="code hl_variable" href="struct_a_v_i___i_n_f_o.html#a3bdc883455d9732f65c9d4cb1aebe28b">Height</a>)</div>
<div class="line"><a id="l00631" name="l00631"></a><span class="lineno">  631</span>    {</div>
<div class="line"><a id="l00632" name="l00632"></a><span class="lineno">  632</span>        LCD-&gt;L[<a class="code hl_enumvalue" href="load__mv_8h.html#ab9806189ae8983878b4853db01912f47a007207a8bae3c327ad4531fa3e5fac93">LAYER_1_GUI</a>].ADDR = (uint32_t)mem_ptr;</div>
<div class="line"><a id="l00633" name="l00633"></a><span class="lineno">  633</span>        LCD-&gt;CR |= (1 &lt;&lt; LCD_CR_VBPRELOAD_Pos); <span class="comment">// 1 帧显示开始时，将层配置寄存器的值加载到层工作寄存器中</span></div>
<div class="line"><a id="l00634" name="l00634"></a><span class="lineno">  634</span>    }</div>
<div class="line"><a id="l00635" name="l00635"></a><span class="lineno">  635</span>    <span class="keywordflow">else</span> <span class="comment">// 播放局部区域视频使用 LAYER_2_VIDEO 进行混合叠图应用</span></div>
<div class="line"><a id="l00636" name="l00636"></a><span class="lineno">  636</span>    {</div>
<div class="line"><a id="l00637" name="l00637"></a><span class="lineno">  637</span>        <span class="comment">// 默认起始位置</span></div>
<div class="line"><a id="l00638" name="l00638"></a><span class="lineno">  638</span>        uint16_t x = 0, y = 0;</div>
<div class="line"><a id="l00639" name="l00639"></a><span class="lineno">  639</span>        LCD_LayerInitStructure LCD_LayerInStruct;</div>
<div class="line"><a id="l00640" name="l00640"></a><span class="lineno">  640</span>        LCD_LayerInStruct.Alpha = 0xFF; <span class="comment">// 默认不透明</span></div>
<div class="line"><a id="l00641" name="l00641"></a><span class="lineno">  641</span>        LCD_LayerInStruct.HStart = (x &gt;= <a class="code hl_define" href="version_8h.html#a23a8c652045ed1831883b0c6785bea16">LCD_HDOT</a> - 1) ? (<a class="code hl_define" href="version_8h.html#a23a8c652045ed1831883b0c6785bea16">LCD_HDOT</a> - <a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>.<a class="code hl_variable" href="struct_a_v_i___i_n_f_o.html#ad672690f555bb08866a491753109e551">Width</a> - 1) : x;</div>
<div class="line"><a id="l00642" name="l00642"></a><span class="lineno">  642</span>        LCD_LayerInStruct.VStart = (y &gt;= <a class="code hl_define" href="version_8h.html#a13286deaebfd1c39a4e3638e8718c274">LCD_VDOT</a> - 1) ? (<a class="code hl_define" href="version_8h.html#a13286deaebfd1c39a4e3638e8718c274">LCD_VDOT</a> - <a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>.<a class="code hl_variable" href="struct_a_v_i___i_n_f_o.html#a3bdc883455d9732f65c9d4cb1aebe28b">Height</a> - 1) : y;</div>
<div class="line"><a id="l00643" name="l00643"></a><span class="lineno">  643</span>        <span class="comment">// Stop 必须大于 Start, 且 HStart - HStop必须为奇数</span></div>
<div class="line"><a id="l00644" name="l00644"></a><span class="lineno">  644</span>        LCD_LayerInStruct.HStop = ((LCD_LayerInStruct.HStart + <a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>.<a class="code hl_variable" href="struct_a_v_i___i_n_f_o.html#ad672690f555bb08866a491753109e551">Width</a>) &gt; <a class="code hl_define" href="version_8h.html#a23a8c652045ed1831883b0c6785bea16">LCD_HDOT</a>) ? (<a class="code hl_define" href="version_8h.html#a23a8c652045ed1831883b0c6785bea16">LCD_HDOT</a> - 1) : (LCD_LayerInStruct.HStart + <a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>.<a class="code hl_variable" href="struct_a_v_i___i_n_f_o.html#ad672690f555bb08866a491753109e551">Width</a> - 1);</div>
<div class="line"><a id="l00645" name="l00645"></a><span class="lineno">  645</span>        LCD_LayerInStruct.VStop = ((LCD_LayerInStruct.VStart + <a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>.<a class="code hl_variable" href="struct_a_v_i___i_n_f_o.html#a3bdc883455d9732f65c9d4cb1aebe28b">Height</a>) &gt; <a class="code hl_define" href="version_8h.html#a13286deaebfd1c39a4e3638e8718c274">LCD_VDOT</a>) ? (<a class="code hl_define" href="version_8h.html#a13286deaebfd1c39a4e3638e8718c274">LCD_VDOT</a> - 1) : (LCD_LayerInStruct.VStart + <a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>.<a class="code hl_variable" href="struct_a_v_i___i_n_f_o.html#a3bdc883455d9732f65c9d4cb1aebe28b">Height</a> - 1);</div>
<div class="line"><a id="l00646" name="l00646"></a><span class="lineno">  646</span>        LCD_LayerInStruct.DataSource = (uint32_t)mem_ptr; <span class="comment">// 数据源地址</span></div>
<div class="line"><a id="l00647" name="l00647"></a><span class="lineno">  647</span>        LCD_LayerInit(LCD, <a class="code hl_enumvalue" href="load__mv_8h.html#ab9806189ae8983878b4853db01912f47a385d7e8b722132d2e22f31b06e30be97">LAYER_2_VIDEO</a>, &amp;LCD_LayerInStruct);</div>
<div class="line"><a id="l00648" name="l00648"></a><span class="lineno">  648</span> </div>
<div class="line"><a id="l00649" name="l00649"></a><span class="lineno">  649</span>        <span class="comment">// LCD-&gt;L[LAYER_2_VIDEO].LCR &amp;= ~(1 &lt;&lt; LCD_LCR_EN_Pos);     //位置还未正确设定,先不显示</span></div>
<div class="line"><a id="l00650" name="l00650"></a><span class="lineno">  650</span>        <span class="comment">// LCD-&gt;CR |= (1 &lt;&lt; LCD_CR_VBPRELOAD_Pos);              // 1 帧显示开始时，将层配置寄存器的值加载到层工作寄存器中</span></div>
<div class="line"><a id="l00651" name="l00651"></a><span class="lineno">  651</span>    }</div>
<div class="line"><a id="l00652" name="l00652"></a><span class="lineno">  652</span>    <span class="comment">//--------------------------------------------------------------视频音轨处理---------------------------------------------------------------------------------//</span></div>
<div class="line"><a id="l00653" name="l00653"></a><span class="lineno">  653</span>    <span class="keywordflow">if</span> (<a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>.<a class="code hl_variable" href="struct_a_v_i___i_n_f_o.html#ae256ff66a407ed8f0a929b4159c91871">AudioBufSize</a> &gt; 0) <span class="comment">// 视频源有音轨</span></div>
<div class="line"><a id="l00654" name="l00654"></a><span class="lineno">  654</span>    {</div>
<div class="line"><a id="l00655" name="l00655"></a><span class="lineno">  655</span>        <span class="keywordflow">if</span> (<a class="code hl_define" href="avi__parser_8h.html#a22a862f67b94bbd8914549bba40d291f">AVI_AUDS_FLAG</a> == <a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>.<a class="code hl_variable" href="struct_a_v_i___i_n_f_o.html#aebe839b9a64cd04e96f275be975f3661">StreamID</a>) <span class="comment">// 音频帧在前</span></div>
<div class="line"><a id="l00656" name="l00656"></a><span class="lineno">  656</span>        {</div>
<div class="line"><a id="l00657" name="l00657"></a><span class="lineno">  657</span>            f_res = f_read(&amp;<a class="code hl_variable" href="load__mv_8c.html#a4dad906d6569beca6b524a122e5ebb11">File_Handle</a>, &amp;(<a class="code hl_variable" href="load__mv_8c.html#a23bd76710e0085785dc0c07eee9f562b">Audio_Control</a>.<a class="code hl_variable" href="structppbuf__t.html#aba0654c8fda9f3e4182659c72e1f3942">buf</a>[<a class="code hl_variable" href="load__mv_8c.html#a23bd76710e0085785dc0c07eee9f562b">Audio_Control</a>.<a class="code hl_variable" href="structppbuf__t.html#ae68c54fbb92dacb8fa2a18389de52f9f">ping</a> * <a class="code hl_define" href="load__mv_8c.html#aa7c703137502abaebf7487b6d19a7565">PCM_BUFSIZE</a>]), <a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>.<a class="code hl_variable" href="struct_a_v_i___i_n_f_o.html#ae9f33841c7538c99150077f9c04d7070">StreamSize</a>, &amp;read_len);</div>
<div class="line"><a id="l00658" name="l00658"></a><span class="lineno">  658</span>            <span class="keywordflow">if</span> (FR_OK != f_res || 0 == <a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>.<a class="code hl_variable" href="struct_a_v_i___i_n_f_o.html#ae9f33841c7538c99150077f9c04d7070">StreamSize</a> || 0 == read_len) <span class="comment">// 判断当前帧有无音轨数据</span></div>
<div class="line"><a id="l00659" name="l00659"></a><span class="lineno">  659</span>            {</div>
<div class="line"><a id="l00660" name="l00660"></a><span class="lineno">  660</span>                <a class="code hl_define" href="load__mv_8c.html#abd1e47f634a69dfe15a08cf0ca6219b0">MV_LOG</a>(<span class="stringliteral">&quot;[%s] file [f_read] read_len = [%d], result = [%s]\r\n&quot;</span>, file_path, read_len, <a class="code hl_variable" href="load__mv_8c.html#a158fc3faa30ddbece4360f3114710212">Debug_FR_Table</a>[f_res]);</div>
<div class="line"><a id="l00661" name="l00661"></a><span class="lineno">  661</span>                <span class="keywordflow">goto</span> error_parser_avi;</div>
<div class="line"><a id="l00662" name="l00662"></a><span class="lineno">  662</span>            }</div>
<div class="line"><a id="l00663" name="l00663"></a><span class="lineno">  663</span>            <span class="comment">// wav 文件中解析出的音频数据是 int16_t，需要加上 0x8000 转换成 uint16_t 发送给 dac</span></div>
<div class="line"><a id="l00664" name="l00664"></a><span class="lineno">  664</span>            <span class="keywordflow">for</span> (uint32_t i = 0; i &lt; <a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>.<a class="code hl_variable" href="struct_a_v_i___i_n_f_o.html#ae9f33841c7538c99150077f9c04d7070">StreamSize</a> / <span class="keyword">sizeof</span>(uint16_t); ++i)</div>
<div class="line"><a id="l00665" name="l00665"></a><span class="lineno">  665</span>            {</div>
<div class="line"><a id="l00666" name="l00666"></a><span class="lineno">  666</span>                <a class="code hl_variable" href="load__mv_8c.html#a23bd76710e0085785dc0c07eee9f562b">Audio_Control</a>.<a class="code hl_variable" href="structppbuf__t.html#aba0654c8fda9f3e4182659c72e1f3942">buf</a>[<a class="code hl_variable" href="load__mv_8c.html#a23bd76710e0085785dc0c07eee9f562b">Audio_Control</a>.<a class="code hl_variable" href="structppbuf__t.html#ae68c54fbb92dacb8fa2a18389de52f9f">ping</a> * <a class="code hl_define" href="load__mv_8c.html#aa7c703137502abaebf7487b6d19a7565">PCM_BUFSIZE</a> + i] += 32768;</div>
<div class="line"><a id="l00667" name="l00667"></a><span class="lineno">  667</span>            }</div>
<div class="line"><a id="l00668" name="l00668"></a><span class="lineno">  668</span>            <span class="comment">// 音频流 ID 信息</span></div>
<div class="line"><a id="l00669" name="l00669"></a><span class="lineno">  669</span>            uint8_t stream_buff[8] = {0};</div>
<div class="line"><a id="l00670" name="l00670"></a><span class="lineno">  670</span>            f_res = f_read(&amp;<a class="code hl_variable" href="load__mv_8c.html#a4dad906d6569beca6b524a122e5ebb11">File_Handle</a>, stream_buff, 8, &amp;read_len);</div>
<div class="line"><a id="l00671" name="l00671"></a><span class="lineno">  671</span>            <span class="keywordflow">if</span> (FR_OK != f_res || 0 == read_len)</div>
<div class="line"><a id="l00672" name="l00672"></a><span class="lineno">  672</span>            {</div>
<div class="line"><a id="l00673" name="l00673"></a><span class="lineno">  673</span>                <a class="code hl_define" href="load__mv_8c.html#abd1e47f634a69dfe15a08cf0ca6219b0">MV_LOG</a>(<span class="stringliteral">&quot;[%s] file [f_read] read_len = [%d], result = [%s]\r\n&quot;</span>, file_path, read_len, <a class="code hl_variable" href="load__mv_8c.html#a158fc3faa30ddbece4360f3114710212">Debug_FR_Table</a>[f_res]);</div>
<div class="line"><a id="l00674" name="l00674"></a><span class="lineno">  674</span>                <span class="keywordflow">goto</span> error_parser_avi;</div>
<div class="line"><a id="l00675" name="l00675"></a><span class="lineno">  675</span>            }</div>
<div class="line"><a id="l00676" name="l00676"></a><span class="lineno">  676</span>            <span class="comment">// 读取下一帧 流标志</span></div>
<div class="line"><a id="l00677" name="l00677"></a><span class="lineno">  677</span>            avi_res = <a class="code hl_function" href="avi__parser_8c.html#a73b7c644cef0ac1324602e57006ba23c">avi_get_streaminfo</a>(stream_buff);</div>
<div class="line"><a id="l00678" name="l00678"></a><span class="lineno">  678</span>            <span class="keywordflow">if</span> (<a class="code hl_enumvalue" href="avi__parser_8h.html#a5fb6196ec8881cca7d4205dff28d5bb7a55b5c2e0d0717e8a2ee2d4d83c04d74e">AVI_OK</a> != avi_res)</div>
<div class="line"><a id="l00679" name="l00679"></a><span class="lineno">  679</span>            {</div>
<div class="line"><a id="l00680" name="l00680"></a><span class="lineno">  680</span>                <a class="code hl_define" href="load__mv_8c.html#abd1e47f634a69dfe15a08cf0ca6219b0">MV_LOG</a>(<span class="stringliteral">&quot;[%s] file [avi_get_streaminfo] result error[%d]\r\n&quot;</span>, file_path, avi_res);</div>
<div class="line"><a id="l00681" name="l00681"></a><span class="lineno">  681</span>                <span class="keywordflow">goto</span> error_parser_avi;</div>
<div class="line"><a id="l00682" name="l00682"></a><span class="lineno">  682</span>            }</div>
<div class="line"><a id="l00683" name="l00683"></a><span class="lineno">  683</span>        }</div>
<div class="line"><a id="l00684" name="l00684"></a><span class="lineno">  684</span>        <span class="comment">/* 按音频采样率播放音频, 每 Avix.SampleRate 微秒 触发 DMA 向 DAC 搬运 1 个 Uint */</span></div>
<div class="line"><a id="l00685" name="l00685"></a><span class="lineno">  685</span>        <a class="code hl_function" href="dev__dac_8c.html#a1cbb394145c7d8b7a7d17fc24a2d6406">dac_dma_init</a>((uint16_t *)&amp;<a class="code hl_variable" href="load__mv_8c.html#a23bd76710e0085785dc0c07eee9f562b">Audio_Control</a>.<a class="code hl_variable" href="structppbuf__t.html#aba0654c8fda9f3e4182659c72e1f3942">buf</a>[<a class="code hl_variable" href="load__mv_8c.html#a23bd76710e0085785dc0c07eee9f562b">Audio_Control</a>.<a class="code hl_variable" href="structppbuf__t.html#ae68c54fbb92dacb8fa2a18389de52f9f">ping</a> * <a class="code hl_define" href="load__mv_8c.html#aa7c703137502abaebf7487b6d19a7565">PCM_BUFSIZE</a>], <a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>.<a class="code hl_variable" href="struct_a_v_i___i_n_f_o.html#ae256ff66a407ed8f0a929b4159c91871">AudioBufSize</a> / <span class="keyword">sizeof</span>(uint16_t), <a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>.<a class="code hl_variable" href="struct_a_v_i___i_n_f_o.html#a930ec675cfdc1a0f18f3414583f7b950">SampleRate</a>);</div>
<div class="line"><a id="l00686" name="l00686"></a><span class="lineno">  686</span>    }</div>
<div class="line"><a id="l00687" name="l00687"></a><span class="lineno">  687</span>    <a class="code hl_variable" href="load__mv_8c.html#a492fd8587926eace74ba1054485d66b5">IRQ_Flag_Frame</a> = <a class="code hl_enumvalue" href="load__mv_8c.html#a3d600ad47f709a0dcfa5cbf1a00fc31aa0d077f5b932ce05e5b9f30c6087a2f31">NO</a>; <span class="comment">// AVI帧传输状态</span></div>
<div class="line"><a id="l00688" name="l00688"></a><span class="lineno">  688</span> </div>
<div class="line"><a id="l00689" name="l00689"></a><span class="lineno">  689</span>    <span class="comment">// AVI_TIMR 用于控制帧率，每 Avix.SecPerFrame us 中断一次</span></div>
<div class="line"><a id="l00690" name="l00690"></a><span class="lineno">  690</span>    TIMR_Init(<a class="code hl_define" href="load__mv_8c.html#a35c6cf21059ba899b846d63b5224dc54">TIMR_AVI</a>, TIMR_MODE_TIMER, CyclesPerUs, <a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>.<a class="code hl_variable" href="struct_a_v_i___i_n_f_o.html#a780dbba77a0f21fe07b1facf6aba3dd3">SecPerFrame</a>, 1);</div>
<div class="line"><a id="l00691" name="l00691"></a><span class="lineno">  691</span>    TIMR_Start(<a class="code hl_define" href="load__mv_8c.html#a35c6cf21059ba899b846d63b5224dc54">TIMR_AVI</a>);</div>
<div class="line"><a id="l00692" name="l00692"></a><span class="lineno">  692</span> </div>
<div class="line"><a id="l00693" name="l00693"></a><span class="lineno">  693</span>    <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="load__mv_8c.html#aefd70b8b91d72cbd548b6c38f385983ba670e07d99593e66c665616d780ffb00e">fsm_state_run_avi</a>;</div>
<div class="line"><a id="l00694" name="l00694"></a><span class="lineno">  694</span> </div>
<div class="line"><a id="l00695" name="l00695"></a><span class="lineno">  695</span>error_parser_avi:</div>
<div class="line"><a id="l00696" name="l00696"></a><span class="lineno">  696</span>    f_close(&amp;<a class="code hl_variable" href="load__mv_8c.html#a4dad906d6569beca6b524a122e5ebb11">File_Handle</a>);</div>
<div class="line"><a id="l00697" name="l00697"></a><span class="lineno">  697</span>    <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="load__mv_8c.html#aefd70b8b91d72cbd548b6c38f385983bab470eb20dd049d7bdce38bc9ae5f0db1">fsm_state_idle</a>;</div>
<div class="line"><a id="l00698" name="l00698"></a><span class="lineno">  698</span>}</div>
<div class="line"><a id="l00699" name="l00699"></a><span class="lineno">  699</span> </div>
<div class="line"><a id="l00705" name="l00705"></a><span class="lineno"><a class="line" href="load__mv_8c.html#a0beb39d84c085c9baadb8a933edf1e53">  705</a></span><span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code hl_function" href="load__mv_8c.html#a0beb39d84c085c9baadb8a933edf1e53">cb_parser_wav</a>(<span class="keywordtype">void</span> *data)</div>
<div class="line"><a id="l00706" name="l00706"></a><span class="lineno">  706</span>{</div>
<div class="line"><a id="l00707" name="l00707"></a><span class="lineno">  707</span>    <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> file_path = data;</div>
<div class="line"><a id="l00708" name="l00708"></a><span class="lineno">  708</span>    FRESULT f_res = FR_OK;</div>
<div class="line"><a id="l00709" name="l00709"></a><span class="lineno">  709</span>    uint32_t read_len = 0;</div>
<div class="line"><a id="l00710" name="l00710"></a><span class="lineno">  710</span>    uint8_t wav_head_buf[512] = {0};</div>
<div class="line"><a id="l00711" name="l00711"></a><span class="lineno">  711</span> </div>
<div class="line"><a id="l00712" name="l00712"></a><span class="lineno">  712</span>    <span class="comment">// 打开文件</span></div>
<div class="line"><a id="l00713" name="l00713"></a><span class="lineno">  713</span>    f_res = f_open(&amp;<a class="code hl_variable" href="load__mv_8c.html#a4dad906d6569beca6b524a122e5ebb11">File_Handle</a>, file_path, FA_READ | FA_OPEN_EXISTING);</div>
<div class="line"><a id="l00714" name="l00714"></a><span class="lineno">  714</span>    <span class="keywordflow">if</span> (FR_OK != f_res)</div>
<div class="line"><a id="l00715" name="l00715"></a><span class="lineno">  715</span>    {</div>
<div class="line"><a id="l00716" name="l00716"></a><span class="lineno">  716</span>        <a class="code hl_define" href="load__mv_8c.html#abd1e47f634a69dfe15a08cf0ca6219b0">MV_LOG</a>(<span class="stringliteral">&quot;[%s] file [f_open] result = [%s]\r\n&quot;</span>, file_path, <a class="code hl_variable" href="load__mv_8c.html#a158fc3faa30ddbece4360f3114710212">Debug_FR_Table</a>[f_res]);</div>
<div class="line"><a id="l00717" name="l00717"></a><span class="lineno">  717</span>        <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="load__mv_8c.html#aefd70b8b91d72cbd548b6c38f385983bab470eb20dd049d7bdce38bc9ae5f0db1">fsm_state_idle</a>;</div>
<div class="line"><a id="l00718" name="l00718"></a><span class="lineno">  718</span>    }</div>
<div class="line"><a id="l00719" name="l00719"></a><span class="lineno">  719</span>    <span class="comment">// 读取 wav 文件头</span></div>
<div class="line"><a id="l00720" name="l00720"></a><span class="lineno">  720</span>    f_res = f_read(&amp;<a class="code hl_variable" href="load__mv_8c.html#a4dad906d6569beca6b524a122e5ebb11">File_Handle</a>, wav_head_buf, <span class="keyword">sizeof</span>(wav_head_buf), &amp;read_len); <span class="comment">// 读取 512 字节头数据</span></div>
<div class="line"><a id="l00721" name="l00721"></a><span class="lineno">  721</span>    <span class="keywordflow">if</span> (FR_OK != f_res || 0 == read_len)</div>
<div class="line"><a id="l00722" name="l00722"></a><span class="lineno">  722</span>    {</div>
<div class="line"><a id="l00723" name="l00723"></a><span class="lineno">  723</span>        <a class="code hl_define" href="load__mv_8c.html#abd1e47f634a69dfe15a08cf0ca6219b0">MV_LOG</a>(<span class="stringliteral">&quot;[%s] file [f_read] read_len = [%d], result = [%s]\r\n&quot;</span>, file_path, read_len, <a class="code hl_variable" href="load__mv_8c.html#a158fc3faa30ddbece4360f3114710212">Debug_FR_Table</a>[f_res]);</div>
<div class="line"><a id="l00724" name="l00724"></a><span class="lineno">  724</span>        <span class="keywordflow">goto</span> error_parser_wav;</div>
<div class="line"><a id="l00725" name="l00725"></a><span class="lineno">  725</span>    }</div>
<div class="line"><a id="l00726" name="l00726"></a><span class="lineno">  726</span>    <span class="comment">// 对文件头进行解析</span></div>
<div class="line"><a id="l00727" name="l00727"></a><span class="lineno">  727</span>    <span class="keywordflow">if</span> (0 != <a class="code hl_function" href="wav__parser_8c.html#acc10199929987de81dc6d395c39832c0">wav_init</a>((uint8_t *)wav_head_buf, read_len))</div>
<div class="line"><a id="l00728" name="l00728"></a><span class="lineno">  728</span>    {</div>
<div class="line"><a id="l00729" name="l00729"></a><span class="lineno">  729</span>        <a class="code hl_define" href="load__mv_8c.html#abd1e47f634a69dfe15a08cf0ca6219b0">MV_LOG</a>(<span class="stringliteral">&quot;[%s] file [wav_init] result error, read_len = [%d]\r\n&quot;</span>, file_path, read_len);</div>
<div class="line"><a id="l00730" name="l00730"></a><span class="lineno">  730</span>        <span class="keywordflow">goto</span> error_parser_wav;</div>
<div class="line"><a id="l00731" name="l00731"></a><span class="lineno">  731</span>    }</div>
<div class="line"><a id="l00732" name="l00732"></a><span class="lineno">  732</span>    <span class="comment">// 跳过文件头</span></div>
<div class="line"><a id="l00733" name="l00733"></a><span class="lineno">  733</span>    f_lseek(&amp;<a class="code hl_variable" href="load__mv_8c.html#a4dad906d6569beca6b524a122e5ebb11">File_Handle</a>, <a class="code hl_variable" href="wav__parser_8c.html#aac71309979edec17487770ba9f4650a6">Wavx</a>.<a class="code hl_variable" href="struct_w_a_v___i_n_f_o.html#ad724f0361ba01c7bfb66c62592612538">datastart</a>);</div>
<div class="line"><a id="l00734" name="l00734"></a><span class="lineno">  734</span> </div>
<div class="line"><a id="l00735" name="l00735"></a><span class="lineno">  735</span>    <span class="comment">// 读取第一个音轨</span></div>
<div class="line"><a id="l00736" name="l00736"></a><span class="lineno">  736</span>    f_res = f_read(&amp;<a class="code hl_variable" href="load__mv_8c.html#a4dad906d6569beca6b524a122e5ebb11">File_Handle</a>, &amp;<a class="code hl_variable" href="load__mv_8c.html#a23bd76710e0085785dc0c07eee9f562b">Audio_Control</a>.<a class="code hl_variable" href="structppbuf__t.html#aba0654c8fda9f3e4182659c72e1f3942">buf</a>[<a class="code hl_variable" href="load__mv_8c.html#a23bd76710e0085785dc0c07eee9f562b">Audio_Control</a>.<a class="code hl_variable" href="structppbuf__t.html#ae68c54fbb92dacb8fa2a18389de52f9f">ping</a> * <a class="code hl_define" href="load__mv_8c.html#aa7c703137502abaebf7487b6d19a7565">PCM_BUFSIZE</a>], <a class="code hl_define" href="load__mv_8c.html#aa7c703137502abaebf7487b6d19a7565">PCM_BUFSIZE</a> * <span class="keyword">sizeof</span>(uint16_t), &amp;read_len);</div>
<div class="line"><a id="l00737" name="l00737"></a><span class="lineno">  737</span>    <span class="keywordflow">if</span> (FR_OK != f_res || 0 == read_len)</div>
<div class="line"><a id="l00738" name="l00738"></a><span class="lineno">  738</span>    {</div>
<div class="line"><a id="l00739" name="l00739"></a><span class="lineno">  739</span>        <a class="code hl_define" href="load__mv_8c.html#abd1e47f634a69dfe15a08cf0ca6219b0">MV_LOG</a>(<span class="stringliteral">&quot;[%s] file [f_read] read_len = [%d], result = [%s]\r\n&quot;</span>, file_path, read_len, <a class="code hl_variable" href="load__mv_8c.html#a158fc3faa30ddbece4360f3114710212">Debug_FR_Table</a>[f_res]);</div>
<div class="line"><a id="l00740" name="l00740"></a><span class="lineno">  740</span>        <span class="keywordflow">goto</span> error_parser_wav;</div>
<div class="line"><a id="l00741" name="l00741"></a><span class="lineno">  741</span>    }</div>
<div class="line"><a id="l00742" name="l00742"></a><span class="lineno">  742</span>    <span class="comment">/*不够数据了,补充 0</span></div>
<div class="line"><a id="l00743" name="l00743"></a><span class="lineno">  743</span><span class="comment">    if (read_len &lt; PCM_BUFSIZE * sizeof(uint16_t))</span></div>
<div class="line"><a id="l00744" name="l00744"></a><span class="lineno">  744</span><span class="comment">    {</span></div>
<div class="line"><a id="l00745" name="l00745"></a><span class="lineno">  745</span><span class="comment">        for (uint32_t i = read_len / sizeof(uint16_t); i &lt; (PCM_BUFSIZE - (read_len / sizeof(uint16_t))); ++i)</span></div>
<div class="line"><a id="l00746" name="l00746"></a><span class="lineno">  746</span><span class="comment">            Audio_Control.buf[Audio_Control.ping * PCM_BUFSIZE + i] = 0;</span></div>
<div class="line"><a id="l00747" name="l00747"></a><span class="lineno">  747</span><span class="comment">    }</span></div>
<div class="line"><a id="l00748" name="l00748"></a><span class="lineno">  748</span><span class="comment">    */</span></div>
<div class="line"><a id="l00749" name="l00749"></a><span class="lineno">  749</span>    <span class="comment">// wav 文件中解析出的音频数据是 int16_t，需要加上 0x8000 转换成 uint16_t 发送给 dac</span></div>
<div class="line"><a id="l00750" name="l00750"></a><span class="lineno">  750</span>    <span class="keywordflow">for</span> (uint32_t i = 0; i &lt; read_len / <span class="keyword">sizeof</span>(uint16_t); ++i)</div>
<div class="line"><a id="l00751" name="l00751"></a><span class="lineno">  751</span>    {</div>
<div class="line"><a id="l00752" name="l00752"></a><span class="lineno">  752</span>        <a class="code hl_variable" href="load__mv_8c.html#a23bd76710e0085785dc0c07eee9f562b">Audio_Control</a>.<a class="code hl_variable" href="structppbuf__t.html#aba0654c8fda9f3e4182659c72e1f3942">buf</a>[<a class="code hl_variable" href="load__mv_8c.html#a23bd76710e0085785dc0c07eee9f562b">Audio_Control</a>.<a class="code hl_variable" href="structppbuf__t.html#ae68c54fbb92dacb8fa2a18389de52f9f">ping</a> * <a class="code hl_define" href="load__mv_8c.html#aa7c703137502abaebf7487b6d19a7565">PCM_BUFSIZE</a> + i] += 32768;</div>
<div class="line"><a id="l00753" name="l00753"></a><span class="lineno">  753</span>    }</div>
<div class="line"><a id="l00754" name="l00754"></a><span class="lineno">  754</span> </div>
<div class="line"><a id="l00755" name="l00755"></a><span class="lineno">  755</span>    <span class="comment">/* 按音频采样率播放音频, 每 Wavx.samplerate 微秒 触发 DMA 向 DAC 搬运 1 个 Uint */</span></div>
<div class="line"><a id="l00756" name="l00756"></a><span class="lineno">  756</span>    <a class="code hl_function" href="dev__dac_8c.html#a1cbb394145c7d8b7a7d17fc24a2d6406">dac_dma_init</a>((uint16_t *)&amp;<a class="code hl_variable" href="load__mv_8c.html#a23bd76710e0085785dc0c07eee9f562b">Audio_Control</a>.<a class="code hl_variable" href="structppbuf__t.html#aba0654c8fda9f3e4182659c72e1f3942">buf</a>[<a class="code hl_variable" href="load__mv_8c.html#a23bd76710e0085785dc0c07eee9f562b">Audio_Control</a>.<a class="code hl_variable" href="structppbuf__t.html#ae68c54fbb92dacb8fa2a18389de52f9f">ping</a> * <a class="code hl_define" href="load__mv_8c.html#aa7c703137502abaebf7487b6d19a7565">PCM_BUFSIZE</a>], read_len / <span class="keyword">sizeof</span>(uint16_t), <a class="code hl_variable" href="wav__parser_8c.html#aac71309979edec17487770ba9f4650a6">Wavx</a>.<a class="code hl_variable" href="struct_w_a_v___i_n_f_o.html#a370f2f23a5016862b7862b5e90f90842">samplerate</a>);</div>
<div class="line"><a id="l00757" name="l00757"></a><span class="lineno">  757</span> </div>
<div class="line"><a id="l00758" name="l00758"></a><span class="lineno">  758</span>    <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="load__mv_8c.html#aefd70b8b91d72cbd548b6c38f385983bad9853dc519c747cd4515e80a7b242ea8">fsm_state_run_wav</a>;</div>
<div class="line"><a id="l00759" name="l00759"></a><span class="lineno">  759</span> </div>
<div class="line"><a id="l00760" name="l00760"></a><span class="lineno">  760</span>error_parser_wav:</div>
<div class="line"><a id="l00761" name="l00761"></a><span class="lineno">  761</span>    f_close(&amp;<a class="code hl_variable" href="load__mv_8c.html#a4dad906d6569beca6b524a122e5ebb11">File_Handle</a>);</div>
<div class="line"><a id="l00762" name="l00762"></a><span class="lineno">  762</span>    <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="load__mv_8c.html#aefd70b8b91d72cbd548b6c38f385983bab470eb20dd049d7bdce38bc9ae5f0db1">fsm_state_idle</a>;</div>
<div class="line"><a id="l00763" name="l00763"></a><span class="lineno">  763</span>}</div>
<div class="line"><a id="l00764" name="l00764"></a><span class="lineno">  764</span> </div>
<div class="line"><a id="l00770" name="l00770"></a><span class="lineno"><a class="line" href="load__mv_8c.html#a3a29f68f2d856a9c2eea3a328d5233e8">  770</a></span><span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code hl_function" href="load__mv_8c.html#a3a29f68f2d856a9c2eea3a328d5233e8">cb_decode_avi</a>(<span class="keywordtype">void</span> *data)</div>
<div class="line"><a id="l00771" name="l00771"></a><span class="lineno">  771</span>{</div>
<div class="line"><a id="l00772" name="l00772"></a><span class="lineno">  772</span>    FRESULT f_res = FR_OK;</div>
<div class="line"><a id="l00773" name="l00773"></a><span class="lineno">  773</span>    uint32_t read_len = 0;</div>
<div class="line"><a id="l00774" name="l00774"></a><span class="lineno">  774</span> </div>
<div class="line"><a id="l00775" name="l00775"></a><span class="lineno">  775</span>    <span class="keywordflow">if</span> (<a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>.<a class="code hl_variable" href="struct_a_v_i___i_n_f_o.html#aebe839b9a64cd04e96f275be975f3661">StreamID</a> == <a class="code hl_define" href="avi__parser_8h.html#a3ece9e152e3d837778a54203fb7477da">AVI_VIDS_FLAG</a> &amp;&amp; <a class="code hl_variable" href="load__mv_8c.html#a492fd8587926eace74ba1054485d66b5">IRQ_Flag_Frame</a> == <a class="code hl_enumvalue" href="load__mv_8c.html#a3d600ad47f709a0dcfa5cbf1a00fc31aa2bc49ec37d6a5715dd23e85f1ff5bb59">OK</a>) <span class="comment">// 视频图像 &amp;&amp; 等待帧时间到达</span></div>
<div class="line"><a id="l00776" name="l00776"></a><span class="lineno">  776</span>    {</div>
<div class="line"><a id="l00777" name="l00777"></a><span class="lineno">  777</span>        <a class="code hl_variable" href="load__mv_8c.html#a492fd8587926eace74ba1054485d66b5">IRQ_Flag_Frame</a> = <a class="code hl_enumvalue" href="load__mv_8c.html#a3d600ad47f709a0dcfa5cbf1a00fc31aa0d077f5b932ce05e5b9f30c6087a2f31">NO</a>; <span class="comment">// 在 TIMR 中断里面设置为 OK</span></div>
<div class="line"><a id="l00778" name="l00778"></a><span class="lineno">  778</span> </div>
<div class="line"><a id="l00779" name="l00779"></a><span class="lineno">  779</span>        <span class="comment">// 如果准备解码下一帧图片时，上一帧图片还没有解码完成，会在此等待，</span></div>
<div class="line"><a id="l00780" name="l00780"></a><span class="lineno">  780</span>        <span class="comment">// 最好不要出现这种情况，如果出现这种情况，表示 MCU 处理不过来，应降低播放视频的帧率</span></div>
<div class="line"><a id="l00781" name="l00781"></a><span class="lineno">  781</span>        <span class="keywordflow">while</span> (<a class="code hl_function" href="dev__jpeg_8c.html#a1cbc17a98f22c1c19a7d33c85a14fccd">jpeg_decode_isbusy</a>() != 0)</div>
<div class="line"><a id="l00782" name="l00782"></a><span class="lineno">  782</span>            ; <span class="comment">// 等待 JPEG 硬件解码器空闲可用</span></div>
<div class="line"><a id="l00783" name="l00783"></a><span class="lineno">  783</span> </div>
<div class="line"><a id="l00784" name="l00784"></a><span class="lineno">  784</span>        <span class="comment">// 读入整帧+下一数据流ID信息</span></div>
<div class="line"><a id="l00785" name="l00785"></a><span class="lineno">  785</span>        f_res = f_read(&amp;<a class="code hl_variable" href="load__mv_8c.html#a4dad906d6569beca6b524a122e5ebb11">File_Handle</a>, <a class="code hl_variable" href="dev__jpeg_8c.html#a134ecf44573e0f7204be01b09c1e48bb">JPEG_Decoder_Buff</a>, <a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>.<a class="code hl_variable" href="struct_a_v_i___i_n_f_o.html#ae9f33841c7538c99150077f9c04d7070">StreamSize</a> + 8, &amp;read_len);</div>
<div class="line"><a id="l00786" name="l00786"></a><span class="lineno">  786</span>        <span class="keywordflow">if</span> (0 != <a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>.<a class="code hl_variable" href="struct_a_v_i___i_n_f_o.html#ae9f33841c7538c99150077f9c04d7070">StreamSize</a>) <span class="comment">// 当前帧有图像数据,则进行解码显示</span></div>
<div class="line"><a id="l00787" name="l00787"></a><span class="lineno">  787</span>        {</div>
<div class="line"><a id="l00788" name="l00788"></a><span class="lineno">  788</span>            <span class="comment">// 进行 JPEG 硬件解码, 非阻塞释放 MCU</span></div>
<div class="line"><a id="l00789" name="l00789"></a><span class="lineno">  789</span>            <a class="code hl_function" href="dev__jpeg_8c.html#ac0e9fc8534c961b9dbba6ad4b8e8b61e">jpeg_decode</a>(<a class="code hl_variable" href="dev__jpeg_8c.html#a134ecf44573e0f7204be01b09c1e48bb">JPEG_Decoder_Buff</a>, <a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>.<a class="code hl_variable" href="struct_a_v_i___i_n_f_o.html#ae9f33841c7538c99150077f9c04d7070">StreamSize</a>, &amp;<a class="code hl_variable" href="load__mv_8c.html#acc289e18199098eb1e60099e71ce5476">Video_OutSet</a>, NULL, 0);</div>
<div class="line"><a id="l00790" name="l00790"></a><span class="lineno">  790</span>            <span class="comment">/*if ( Video_OutSet.RGBAddr == (uint32_t)jpeg_decode() ) */</span></div>
<div class="line"><a id="l00791" name="l00791"></a><span class="lineno">  791</span>        }</div>
<div class="line"><a id="l00792" name="l00792"></a><span class="lineno">  792</span>        <span class="comment">// 读取下一帧 流标志</span></div>
<div class="line"><a id="l00793" name="l00793"></a><span class="lineno">  793</span>        <span class="keywordflow">if</span> (<a class="code hl_enumvalue" href="avi__parser_8h.html#a5fb6196ec8881cca7d4205dff28d5bb7a55b5c2e0d0717e8a2ee2d4d83c04d74e">AVI_OK</a> != <a class="code hl_function" href="avi__parser_8c.html#a73b7c644cef0ac1324602e57006ba23c">avi_get_streaminfo</a>(<a class="code hl_variable" href="dev__jpeg_8c.html#a134ecf44573e0f7204be01b09c1e48bb">JPEG_Decoder_Buff</a> + <a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>.<a class="code hl_variable" href="struct_a_v_i___i_n_f_o.html#ae9f33841c7538c99150077f9c04d7070">StreamSize</a>))</div>
<div class="line"><a id="l00794" name="l00794"></a><span class="lineno">  794</span>        {</div>
<div class="line"><a id="l00795" name="l00795"></a><span class="lineno">  795</span>            <span class="comment">// 累计循环播放次数</span></div>
<div class="line"><a id="l00796" name="l00796"></a><span class="lineno">  796</span>            <span class="keywordflow">if</span> (++<a class="code hl_variable" href="load__mv_8c.html#a47fdfbb31eda448a7ec364e2e724c2b7">Video_Loop_Nums</a> &gt;= <a class="code hl_variable" href="load__mv_8c.html#adc415ff7c829fa6c6a78755deccbc10d">Video_Loop_Max</a>)</div>
<div class="line"><a id="l00797" name="l00797"></a><span class="lineno">  797</span>            {</div>
<div class="line"><a id="l00798" name="l00798"></a><span class="lineno">  798</span>                <a class="code hl_define" href="load__mv_8c.html#abd1e47f634a69dfe15a08cf0ca6219b0">MV_LOG</a>(<span class="stringliteral">&quot;video frame over!\r\n&quot;</span>);</div>
<div class="line"><a id="l00799" name="l00799"></a><span class="lineno">  799</span>                <span class="keywordflow">return</span> <a class="code hl_function" href="load__mv_8c.html#a978ed993bd878f76db92c810771c0ee8">cb_close_avi</a>(data);</div>
<div class="line"><a id="l00800" name="l00800"></a><span class="lineno">  800</span>            }</div>
<div class="line"><a id="l00801" name="l00801"></a><span class="lineno">  801</span>            <span class="comment">// 回到播放第一帧的状态, 避免频繁开关文件句柄带来的效率损失</span></div>
<div class="line"><a id="l00802" name="l00802"></a><span class="lineno">  802</span>            <a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>.<a class="code hl_variable" href="struct_a_v_i___i_n_f_o.html#aebe839b9a64cd04e96f275be975f3661">StreamID</a> = <a class="code hl_variable" href="load__mv_8c.html#a270fa9b5805fcc89bfb0c3f0bcf77c4d">Restart_Stream_ID</a>;</div>
<div class="line"><a id="l00803" name="l00803"></a><span class="lineno">  803</span>            <a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>.<a class="code hl_variable" href="struct_a_v_i___i_n_f_o.html#ae9f33841c7538c99150077f9c04d7070">StreamSize</a> = <a class="code hl_variable" href="load__mv_8c.html#adf6b06c522e8f78610aa821eff3a2508">Restart_StreamSize</a>;</div>
<div class="line"><a id="l00804" name="l00804"></a><span class="lineno">  804</span>            f_lseek(&amp;<a class="code hl_variable" href="load__mv_8c.html#a4dad906d6569beca6b524a122e5ebb11">File_Handle</a>, <a class="code hl_variable" href="load__mv_8c.html#a466f231c4630e48f95aa5980f6d0cc42">Restart_Offset</a> + 12);</div>
<div class="line"><a id="l00805" name="l00805"></a><span class="lineno">  805</span>        }</div>
<div class="line"><a id="l00806" name="l00806"></a><span class="lineno">  806</span>    }</div>
<div class="line"><a id="l00807" name="l00807"></a><span class="lineno">  807</span>    <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>.<a class="code hl_variable" href="struct_a_v_i___i_n_f_o.html#aebe839b9a64cd04e96f275be975f3661">StreamID</a> == <a class="code hl_define" href="avi__parser_8h.html#a22a862f67b94bbd8914549bba40d291f">AVI_AUDS_FLAG</a> &amp;&amp; <a class="code hl_function" href="dev__dac_8c.html#ab18d2dbe4e762641f948bc31b52234f4">dac_dma_transfer_done</a>() == 0) <span class="comment">// 等待上一轨音频播放完成</span></div>
<div class="line"><a id="l00808" name="l00808"></a><span class="lineno">  808</span>    {</div>
<div class="line"><a id="l00809" name="l00809"></a><span class="lineno">  809</span>        <span class="comment">// 读入音轨</span></div>
<div class="line"><a id="l00810" name="l00810"></a><span class="lineno">  810</span>        f_res = f_read(&amp;<a class="code hl_variable" href="load__mv_8c.html#a4dad906d6569beca6b524a122e5ebb11">File_Handle</a>, &amp;<a class="code hl_variable" href="load__mv_8c.html#a23bd76710e0085785dc0c07eee9f562b">Audio_Control</a>.<a class="code hl_variable" href="structppbuf__t.html#aba0654c8fda9f3e4182659c72e1f3942">buf</a>[<a class="code hl_variable" href="load__mv_8c.html#a23bd76710e0085785dc0c07eee9f562b">Audio_Control</a>.<a class="code hl_variable" href="structppbuf__t.html#a29d6f26ef78cbf28c7570503a278b73d">pong</a> * <a class="code hl_define" href="load__mv_8c.html#aa7c703137502abaebf7487b6d19a7565">PCM_BUFSIZE</a>], <a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>.<a class="code hl_variable" href="struct_a_v_i___i_n_f_o.html#ae9f33841c7538c99150077f9c04d7070">StreamSize</a>, &amp;read_len);</div>
<div class="line"><a id="l00811" name="l00811"></a><span class="lineno">  811</span>        <span class="keywordflow">if</span> (FR_OK != f_res || 0 == <a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>.<a class="code hl_variable" href="struct_a_v_i___i_n_f_o.html#ae9f33841c7538c99150077f9c04d7070">StreamSize</a> || 0 == read_len) <span class="comment">// 判断当前帧有无音轨数据</span></div>
<div class="line"><a id="l00812" name="l00812"></a><span class="lineno">  812</span>        {</div>
<div class="line"><a id="l00813" name="l00813"></a><span class="lineno">  813</span>            <span class="comment">// MV_LOG(&quot;[%s] file [f_read] result = [%s], read_len = [%d]\r\n&quot;, File_Path, Debug_FR_Table[f_res], read_len);</span></div>
<div class="line"><a id="l00814" name="l00814"></a><span class="lineno">  814</span>            <span class="keywordflow">while</span> (0 != <a class="code hl_function" href="dev__dac_8c.html#ab18d2dbe4e762641f948bc31b52234f4">dac_dma_transfer_done</a>())</div>
<div class="line"><a id="l00815" name="l00815"></a><span class="lineno">  815</span>                ; <span class="comment">// 阻塞等待最后一个音轨播放完毕</span></div>
<div class="line"><a id="l00816" name="l00816"></a><span class="lineno">  816</span>            <span class="keywordflow">return</span> <a class="code hl_function" href="load__mv_8c.html#a978ed993bd878f76db92c810771c0ee8">cb_close_avi</a>(data);</div>
<div class="line"><a id="l00817" name="l00817"></a><span class="lineno">  817</span>        }</div>
<div class="line"><a id="l00818" name="l00818"></a><span class="lineno">  818</span>        <span class="comment">// wav 文件中解析出的音频数据是 int16_t，需要加上 0x8000 转换成 uint16_t 发送给 dac</span></div>
<div class="line"><a id="l00819" name="l00819"></a><span class="lineno">  819</span>        <span class="keywordflow">for</span> (uint32_t i = 0; i &lt; <a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>.<a class="code hl_variable" href="struct_a_v_i___i_n_f_o.html#ae9f33841c7538c99150077f9c04d7070">StreamSize</a> / <span class="keyword">sizeof</span>(uint16_t); ++i)</div>
<div class="line"><a id="l00820" name="l00820"></a><span class="lineno">  820</span>        {</div>
<div class="line"><a id="l00821" name="l00821"></a><span class="lineno">  821</span>            <a class="code hl_variable" href="load__mv_8c.html#a23bd76710e0085785dc0c07eee9f562b">Audio_Control</a>.<a class="code hl_variable" href="structppbuf__t.html#aba0654c8fda9f3e4182659c72e1f3942">buf</a>[<a class="code hl_variable" href="load__mv_8c.html#a23bd76710e0085785dc0c07eee9f562b">Audio_Control</a>.<a class="code hl_variable" href="structppbuf__t.html#a29d6f26ef78cbf28c7570503a278b73d">pong</a> * <a class="code hl_define" href="load__mv_8c.html#aa7c703137502abaebf7487b6d19a7565">PCM_BUFSIZE</a> + i] += 32768;</div>
<div class="line"><a id="l00822" name="l00822"></a><span class="lineno">  822</span>        }</div>
<div class="line"><a id="l00823" name="l00823"></a><span class="lineno">  823</span>        <span class="comment">// 由于上述转换过程中，直接播放会有卡顿，切换 ping 和 pong 会有改善</span></div>
<div class="line"><a id="l00824" name="l00824"></a><span class="lineno">  824</span>        <a class="code hl_variable" href="load__mv_8c.html#a23bd76710e0085785dc0c07eee9f562b">Audio_Control</a>.<a class="code hl_variable" href="structppbuf__t.html#ae68c54fbb92dacb8fa2a18389de52f9f">ping</a> = <a class="code hl_variable" href="load__mv_8c.html#a23bd76710e0085785dc0c07eee9f562b">Audio_Control</a>.<a class="code hl_variable" href="structppbuf__t.html#ae68c54fbb92dacb8fa2a18389de52f9f">ping</a> ^ <a class="code hl_variable" href="load__mv_8c.html#a23bd76710e0085785dc0c07eee9f562b">Audio_Control</a>.<a class="code hl_variable" href="structppbuf__t.html#a29d6f26ef78cbf28c7570503a278b73d">pong</a>;</div>
<div class="line"><a id="l00825" name="l00825"></a><span class="lineno">  825</span>        <a class="code hl_variable" href="load__mv_8c.html#a23bd76710e0085785dc0c07eee9f562b">Audio_Control</a>.<a class="code hl_variable" href="structppbuf__t.html#a29d6f26ef78cbf28c7570503a278b73d">pong</a> = <a class="code hl_variable" href="load__mv_8c.html#a23bd76710e0085785dc0c07eee9f562b">Audio_Control</a>.<a class="code hl_variable" href="structppbuf__t.html#a29d6f26ef78cbf28c7570503a278b73d">pong</a> ^ <a class="code hl_variable" href="load__mv_8c.html#a23bd76710e0085785dc0c07eee9f562b">Audio_Control</a>.<a class="code hl_variable" href="structppbuf__t.html#ae68c54fbb92dacb8fa2a18389de52f9f">ping</a>;</div>
<div class="line"><a id="l00826" name="l00826"></a><span class="lineno">  826</span>        <a class="code hl_variable" href="load__mv_8c.html#a23bd76710e0085785dc0c07eee9f562b">Audio_Control</a>.<a class="code hl_variable" href="structppbuf__t.html#ae68c54fbb92dacb8fa2a18389de52f9f">ping</a> = <a class="code hl_variable" href="load__mv_8c.html#a23bd76710e0085785dc0c07eee9f562b">Audio_Control</a>.<a class="code hl_variable" href="structppbuf__t.html#ae68c54fbb92dacb8fa2a18389de52f9f">ping</a> ^ <a class="code hl_variable" href="load__mv_8c.html#a23bd76710e0085785dc0c07eee9f562b">Audio_Control</a>.<a class="code hl_variable" href="structppbuf__t.html#a29d6f26ef78cbf28c7570503a278b73d">pong</a>;</div>
<div class="line"><a id="l00827" name="l00827"></a><span class="lineno">  827</span>        <span class="comment">// 切换 DAC_DMA 源</span></div>
<div class="line"><a id="l00828" name="l00828"></a><span class="lineno">  828</span>        DMA-&gt;CH[<a class="code hl_define" href="dev__dac_8h.html#a5cf167f3b1930852accd27d796f47195">DAC_DMA_CHN</a>].SRC = (uint32_t)&amp;<a class="code hl_variable" href="load__mv_8c.html#a23bd76710e0085785dc0c07eee9f562b">Audio_Control</a>.<a class="code hl_variable" href="structppbuf__t.html#aba0654c8fda9f3e4182659c72e1f3942">buf</a>[<a class="code hl_variable" href="load__mv_8c.html#a23bd76710e0085785dc0c07eee9f562b">Audio_Control</a>.<a class="code hl_variable" href="structppbuf__t.html#ae68c54fbb92dacb8fa2a18389de52f9f">ping</a> * <a class="code hl_define" href="load__mv_8c.html#aa7c703137502abaebf7487b6d19a7565">PCM_BUFSIZE</a>];</div>
<div class="line"><a id="l00829" name="l00829"></a><span class="lineno">  829</span>        DMA-&gt;CH[<a class="code hl_define" href="dev__dac_8h.html#a5cf167f3b1930852accd27d796f47195">DAC_DMA_CHN</a>].CR |= ((read_len / <span class="keyword">sizeof</span>(uint16_t) - 1) &lt;&lt; DMA_CR_LEN_Pos);</div>
<div class="line"><a id="l00830" name="l00830"></a><span class="lineno">  830</span>        <span class="comment">// 音频流ID信息</span></div>
<div class="line"><a id="l00831" name="l00831"></a><span class="lineno">  831</span>        uint8_t stream_buff[8] = {0};</div>
<div class="line"><a id="l00832" name="l00832"></a><span class="lineno">  832</span>        f_res = f_read(&amp;<a class="code hl_variable" href="load__mv_8c.html#a4dad906d6569beca6b524a122e5ebb11">File_Handle</a>, stream_buff, 8, &amp;read_len);</div>
<div class="line"><a id="l00833" name="l00833"></a><span class="lineno">  833</span>        <span class="comment">// 读取下一帧 流标志</span></div>
<div class="line"><a id="l00834" name="l00834"></a><span class="lineno">  834</span>        <span class="keywordflow">if</span> (<a class="code hl_enumvalue" href="avi__parser_8h.html#a5fb6196ec8881cca7d4205dff28d5bb7a55b5c2e0d0717e8a2ee2d4d83c04d74e">AVI_OK</a> != <a class="code hl_function" href="avi__parser_8c.html#a73b7c644cef0ac1324602e57006ba23c">avi_get_streaminfo</a>(stream_buff))</div>
<div class="line"><a id="l00835" name="l00835"></a><span class="lineno">  835</span>        {</div>
<div class="line"><a id="l00836" name="l00836"></a><span class="lineno">  836</span>            <span class="comment">// 累计循环播放次数</span></div>
<div class="line"><a id="l00837" name="l00837"></a><span class="lineno">  837</span>            <span class="keywordflow">if</span> (++<a class="code hl_variable" href="load__mv_8c.html#a47fdfbb31eda448a7ec364e2e724c2b7">Video_Loop_Nums</a> &gt;= <a class="code hl_variable" href="load__mv_8c.html#adc415ff7c829fa6c6a78755deccbc10d">Video_Loop_Max</a>)</div>
<div class="line"><a id="l00838" name="l00838"></a><span class="lineno">  838</span>            {</div>
<div class="line"><a id="l00839" name="l00839"></a><span class="lineno">  839</span>                <a class="code hl_define" href="load__mv_8c.html#abd1e47f634a69dfe15a08cf0ca6219b0">MV_LOG</a>(<span class="stringliteral">&quot;video audio over!\r\n&quot;</span>);</div>
<div class="line"><a id="l00840" name="l00840"></a><span class="lineno">  840</span>                <span class="keywordflow">while</span> (0 != <a class="code hl_function" href="dev__dac_8c.html#ab18d2dbe4e762641f948bc31b52234f4">dac_dma_transfer_done</a>())</div>
<div class="line"><a id="l00841" name="l00841"></a><span class="lineno">  841</span>                    ; <span class="comment">// 阻塞等待最后一个音轨播放完毕</span></div>
<div class="line"><a id="l00842" name="l00842"></a><span class="lineno">  842</span>                <span class="keywordflow">return</span> <a class="code hl_function" href="load__mv_8c.html#a978ed993bd878f76db92c810771c0ee8">cb_close_avi</a>(data);</div>
<div class="line"><a id="l00843" name="l00843"></a><span class="lineno">  843</span>            }</div>
<div class="line"><a id="l00844" name="l00844"></a><span class="lineno">  844</span>            <span class="comment">// 回到播放第一帧的状态, 避免频繁开关文件句柄带来的效率损失</span></div>
<div class="line"><a id="l00845" name="l00845"></a><span class="lineno">  845</span>            <a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>.<a class="code hl_variable" href="struct_a_v_i___i_n_f_o.html#aebe839b9a64cd04e96f275be975f3661">StreamID</a> = <a class="code hl_variable" href="load__mv_8c.html#a270fa9b5805fcc89bfb0c3f0bcf77c4d">Restart_Stream_ID</a>;</div>
<div class="line"><a id="l00846" name="l00846"></a><span class="lineno">  846</span>            <a class="code hl_variable" href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a>.<a class="code hl_variable" href="struct_a_v_i___i_n_f_o.html#ae9f33841c7538c99150077f9c04d7070">StreamSize</a> = <a class="code hl_variable" href="load__mv_8c.html#adf6b06c522e8f78610aa821eff3a2508">Restart_StreamSize</a>;</div>
<div class="line"><a id="l00847" name="l00847"></a><span class="lineno">  847</span>            f_lseek(&amp;<a class="code hl_variable" href="load__mv_8c.html#a4dad906d6569beca6b524a122e5ebb11">File_Handle</a>, <a class="code hl_variable" href="load__mv_8c.html#a466f231c4630e48f95aa5980f6d0cc42">Restart_Offset</a> + 12);</div>
<div class="line"><a id="l00848" name="l00848"></a><span class="lineno">  848</span>        }</div>
<div class="line"><a id="l00849" name="l00849"></a><span class="lineno">  849</span>    }</div>
<div class="line"><a id="l00850" name="l00850"></a><span class="lineno">  850</span>    <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="load__mv_8c.html#aefd70b8b91d72cbd548b6c38f385983ba670e07d99593e66c665616d780ffb00e">fsm_state_run_avi</a>;</div>
<div class="line"><a id="l00851" name="l00851"></a><span class="lineno">  851</span>}</div>
<div class="line"><a id="l00852" name="l00852"></a><span class="lineno">  852</span> </div>
<div class="line"><a id="l00858" name="l00858"></a><span class="lineno"><a class="line" href="load__mv_8c.html#ade87c0786f4382f3e221f3a79cef3a01">  858</a></span><span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code hl_function" href="load__mv_8c.html#ade87c0786f4382f3e221f3a79cef3a01">cb_decode_wav</a>(<span class="keywordtype">void</span> *data)</div>
<div class="line"><a id="l00859" name="l00859"></a><span class="lineno">  859</span>{</div>
<div class="line"><a id="l00860" name="l00860"></a><span class="lineno">  860</span>    FRESULT f_res = FR_OK;</div>
<div class="line"><a id="l00861" name="l00861"></a><span class="lineno">  861</span>    uint32_t read_len = 0;</div>
<div class="line"><a id="l00862" name="l00862"></a><span class="lineno">  862</span> </div>
<div class="line"><a id="l00863" name="l00863"></a><span class="lineno">  863</span>    <span class="keywordflow">if</span> (<a class="code hl_function" href="dev__dac_8c.html#ab18d2dbe4e762641f948bc31b52234f4">dac_dma_transfer_done</a>() == 0) </div>
<div class="line"><a id="l00864" name="l00864"></a><span class="lineno">  864</span>    {</div>
<div class="line"><a id="l00865" name="l00865"></a><span class="lineno">  865</span>        <span class="comment">// 读入音轨</span></div>
<div class="line"><a id="l00866" name="l00866"></a><span class="lineno">  866</span>        f_res = f_read(&amp;<a class="code hl_variable" href="load__mv_8c.html#a4dad906d6569beca6b524a122e5ebb11">File_Handle</a>, &amp;<a class="code hl_variable" href="load__mv_8c.html#a23bd76710e0085785dc0c07eee9f562b">Audio_Control</a>.<a class="code hl_variable" href="structppbuf__t.html#aba0654c8fda9f3e4182659c72e1f3942">buf</a>[<a class="code hl_variable" href="load__mv_8c.html#a23bd76710e0085785dc0c07eee9f562b">Audio_Control</a>.<a class="code hl_variable" href="structppbuf__t.html#a29d6f26ef78cbf28c7570503a278b73d">pong</a> * <a class="code hl_define" href="load__mv_8c.html#aa7c703137502abaebf7487b6d19a7565">PCM_BUFSIZE</a>], <a class="code hl_define" href="load__mv_8c.html#aa7c703137502abaebf7487b6d19a7565">PCM_BUFSIZE</a> * <span class="keyword">sizeof</span>(uint16_t), &amp;read_len);</div>
<div class="line"><a id="l00867" name="l00867"></a><span class="lineno">  867</span>        <span class="keywordflow">if</span> (FR_OK != f_res || 0 == read_len)</div>
<div class="line"><a id="l00868" name="l00868"></a><span class="lineno">  868</span>        {</div>
<div class="line"><a id="l00869" name="l00869"></a><span class="lineno">  869</span>            <span class="comment">// MV_LOG(&quot;[%s] file [f_read] result = [%s], read_len = [%d]\r\n&quot;, File_Path, Debug_FR_Table[f_res], read_len);</span></div>
<div class="line"><a id="l00870" name="l00870"></a><span class="lineno">  870</span>            <span class="keywordflow">while</span> (0 != <a class="code hl_function" href="dev__dac_8c.html#ab18d2dbe4e762641f948bc31b52234f4">dac_dma_transfer_done</a>())</div>
<div class="line"><a id="l00871" name="l00871"></a><span class="lineno">  871</span>                ; <span class="comment">// 阻塞等待最后一个音轨播放完毕</span></div>
<div class="line"><a id="l00872" name="l00872"></a><span class="lineno">  872</span>            <span class="keywordflow">return</span> <a class="code hl_function" href="load__mv_8c.html#a79e1ebe637dcb48c69706eb81c73b576">cb_close_wav</a>(data);</div>
<div class="line"><a id="l00873" name="l00873"></a><span class="lineno">  873</span>        }</div>
<div class="line"><a id="l00874" name="l00874"></a><span class="lineno">  874</span>        <span class="comment">/*不够数据了,补充 0</span></div>
<div class="line"><a id="l00875" name="l00875"></a><span class="lineno">  875</span><span class="comment">        if (read_len &lt; PCM_BUFSIZE * sizeof(uint16_t))</span></div>
<div class="line"><a id="l00876" name="l00876"></a><span class="lineno">  876</span><span class="comment">        {</span></div>
<div class="line"><a id="l00877" name="l00877"></a><span class="lineno">  877</span><span class="comment">            for (uint32_t i = read_len / sizeof(uint16_t); i &lt; PCM_BUFSIZE - read_len / sizeof(uint16_t); ++i)</span></div>
<div class="line"><a id="l00878" name="l00878"></a><span class="lineno">  878</span><span class="comment">                Audio_Control.buf[Audio_Control.pong * PCM_BUFSIZE + i] = 0;</span></div>
<div class="line"><a id="l00879" name="l00879"></a><span class="lineno">  879</span><span class="comment">        }</span></div>
<div class="line"><a id="l00880" name="l00880"></a><span class="lineno">  880</span><span class="comment">        */</span></div>
<div class="line"><a id="l00881" name="l00881"></a><span class="lineno">  881</span>        <span class="comment">// wav 文件中解析出的音频数据是 int16_t，需要加上 0x8000 转换成 uint16_t 发送给 dac</span></div>
<div class="line"><a id="l00882" name="l00882"></a><span class="lineno">  882</span>        <span class="keywordflow">for</span> (uint32_t i = 0; i &lt; read_len / <span class="keyword">sizeof</span>(uint16_t); ++i)</div>
<div class="line"><a id="l00883" name="l00883"></a><span class="lineno">  883</span>        {</div>
<div class="line"><a id="l00884" name="l00884"></a><span class="lineno">  884</span>            <a class="code hl_variable" href="load__mv_8c.html#a23bd76710e0085785dc0c07eee9f562b">Audio_Control</a>.<a class="code hl_variable" href="structppbuf__t.html#aba0654c8fda9f3e4182659c72e1f3942">buf</a>[<a class="code hl_variable" href="load__mv_8c.html#a23bd76710e0085785dc0c07eee9f562b">Audio_Control</a>.<a class="code hl_variable" href="structppbuf__t.html#a29d6f26ef78cbf28c7570503a278b73d">pong</a> * <a class="code hl_define" href="load__mv_8c.html#aa7c703137502abaebf7487b6d19a7565">PCM_BUFSIZE</a> + i] += 32768;</div>
<div class="line"><a id="l00885" name="l00885"></a><span class="lineno">  885</span>        }</div>
<div class="line"><a id="l00886" name="l00886"></a><span class="lineno">  886</span>        <span class="comment">// 由于上述转换过程中，直接播放会有卡顿，切换 ping 和 pong 会有改善</span></div>
<div class="line"><a id="l00887" name="l00887"></a><span class="lineno">  887</span>        <a class="code hl_variable" href="load__mv_8c.html#a23bd76710e0085785dc0c07eee9f562b">Audio_Control</a>.<a class="code hl_variable" href="structppbuf__t.html#ae68c54fbb92dacb8fa2a18389de52f9f">ping</a> = <a class="code hl_variable" href="load__mv_8c.html#a23bd76710e0085785dc0c07eee9f562b">Audio_Control</a>.<a class="code hl_variable" href="structppbuf__t.html#ae68c54fbb92dacb8fa2a18389de52f9f">ping</a> ^ <a class="code hl_variable" href="load__mv_8c.html#a23bd76710e0085785dc0c07eee9f562b">Audio_Control</a>.<a class="code hl_variable" href="structppbuf__t.html#a29d6f26ef78cbf28c7570503a278b73d">pong</a>;</div>
<div class="line"><a id="l00888" name="l00888"></a><span class="lineno">  888</span>        <a class="code hl_variable" href="load__mv_8c.html#a23bd76710e0085785dc0c07eee9f562b">Audio_Control</a>.<a class="code hl_variable" href="structppbuf__t.html#a29d6f26ef78cbf28c7570503a278b73d">pong</a> = <a class="code hl_variable" href="load__mv_8c.html#a23bd76710e0085785dc0c07eee9f562b">Audio_Control</a>.<a class="code hl_variable" href="structppbuf__t.html#a29d6f26ef78cbf28c7570503a278b73d">pong</a> ^ <a class="code hl_variable" href="load__mv_8c.html#a23bd76710e0085785dc0c07eee9f562b">Audio_Control</a>.<a class="code hl_variable" href="structppbuf__t.html#ae68c54fbb92dacb8fa2a18389de52f9f">ping</a>;</div>
<div class="line"><a id="l00889" name="l00889"></a><span class="lineno">  889</span>        <a class="code hl_variable" href="load__mv_8c.html#a23bd76710e0085785dc0c07eee9f562b">Audio_Control</a>.<a class="code hl_variable" href="structppbuf__t.html#ae68c54fbb92dacb8fa2a18389de52f9f">ping</a> = <a class="code hl_variable" href="load__mv_8c.html#a23bd76710e0085785dc0c07eee9f562b">Audio_Control</a>.<a class="code hl_variable" href="structppbuf__t.html#ae68c54fbb92dacb8fa2a18389de52f9f">ping</a> ^ <a class="code hl_variable" href="load__mv_8c.html#a23bd76710e0085785dc0c07eee9f562b">Audio_Control</a>.<a class="code hl_variable" href="structppbuf__t.html#a29d6f26ef78cbf28c7570503a278b73d">pong</a>;</div>
<div class="line"><a id="l00890" name="l00890"></a><span class="lineno">  890</span>        <span class="comment">// 切换 DAC_DMA 源</span></div>
<div class="line"><a id="l00891" name="l00891"></a><span class="lineno">  891</span>        DMA-&gt;CH[<a class="code hl_define" href="dev__dac_8h.html#a5cf167f3b1930852accd27d796f47195">DAC_DMA_CHN</a>].SRC = (uint32_t)&amp;<a class="code hl_variable" href="load__mv_8c.html#a23bd76710e0085785dc0c07eee9f562b">Audio_Control</a>.<a class="code hl_variable" href="structppbuf__t.html#aba0654c8fda9f3e4182659c72e1f3942">buf</a>[<a class="code hl_variable" href="load__mv_8c.html#a23bd76710e0085785dc0c07eee9f562b">Audio_Control</a>.<a class="code hl_variable" href="structppbuf__t.html#ae68c54fbb92dacb8fa2a18389de52f9f">ping</a> * <a class="code hl_define" href="load__mv_8c.html#aa7c703137502abaebf7487b6d19a7565">PCM_BUFSIZE</a>];</div>
<div class="line"><a id="l00892" name="l00892"></a><span class="lineno">  892</span>        DMA-&gt;CH[<a class="code hl_define" href="dev__dac_8h.html#a5cf167f3b1930852accd27d796f47195">DAC_DMA_CHN</a>].CR |= ((read_len / <span class="keyword">sizeof</span>(uint16_t) - 1) &lt;&lt; DMA_CR_LEN_Pos);</div>
<div class="line"><a id="l00893" name="l00893"></a><span class="lineno">  893</span>    }</div>
<div class="line"><a id="l00894" name="l00894"></a><span class="lineno">  894</span>    <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="load__mv_8c.html#aefd70b8b91d72cbd548b6c38f385983bad9853dc519c747cd4515e80a7b242ea8">fsm_state_run_wav</a>;</div>
<div class="line"><a id="l00895" name="l00895"></a><span class="lineno">  895</span>}</div>
<div class="ttc" id="aavi__parser_8c_html_a56b444192eb7b54acf7dcac7829e4f45"><div class="ttname"><a href="avi__parser_8c.html#a56b444192eb7b54acf7dcac7829e4f45">avi_srarch_id</a></div><div class="ttdeci">uint16_t avi_srarch_id(uint8_t *buf, uint16_t size, char *id)</div><div class="ttdoc">查找 movi ID</div><div class="ttdef"><b>Definition:</b> <a href="avi__parser_8c_source.html#l00048">avi_parser.c:48</a></div></div>
<div class="ttc" id="aavi__parser_8c_html_a73b7c644cef0ac1324602e57006ba23c"><div class="ttname"><a href="avi__parser_8c.html#a73b7c644cef0ac1324602e57006ba23c">avi_get_streaminfo</a></div><div class="ttdeci">AVISTATUS avi_get_streaminfo(uint8_t *buf)</div><div class="ttdoc">获取 stream 流信息</div><div class="ttdef"><b>Definition:</b> <a href="avi__parser_8c_source.html#l00069">avi_parser.c:69</a></div></div>
<div class="ttc" id="aavi__parser_8c_html_ab72d5be5e6149cfe3dc314d99f5b11c2"><div class="ttname"><a href="avi__parser_8c.html#ab72d5be5e6149cfe3dc314d99f5b11c2">avi_init</a></div><div class="ttdeci">AVISTATUS avi_init(uint8_t *buf, uint16_t size)</div><div class="ttdoc">avi 格式解析</div><div class="ttdef"><b>Definition:</b> <a href="avi__parser_8c_source.html#l00087">avi_parser.c:87</a></div></div>
<div class="ttc" id="aavi__parser_8c_html_afb1c27165f8debcb7125a35d66ffc244"><div class="ttname"><a href="avi__parser_8c.html#afb1c27165f8debcb7125a35d66ffc244">Avix</a></div><div class="ttdeci">AVI_INFO Avix</div><div class="ttdoc">AVI 视频流信息</div><div class="ttdef"><b>Definition:</b> <a href="avi__parser_8c_source.html#l00034">avi_parser.c:34</a></div></div>
<div class="ttc" id="aavi__parser_8h_html"><div class="ttname"><a href="avi__parser_8h.html">avi_parser.h</a></div><div class="ttdoc">avi 视频格式解析</div></div>
<div class="ttc" id="aavi__parser_8h_html_a22a862f67b94bbd8914549bba40d291f"><div class="ttname"><a href="avi__parser_8h.html#a22a862f67b94bbd8914549bba40d291f">AVI_AUDS_FLAG</a></div><div class="ttdeci">#define AVI_AUDS_FLAG</div><div class="ttdoc">音频流标志</div><div class="ttdef"><b>Definition:</b> <a href="avi__parser_8h_source.html#l00042">avi_parser.h:42</a></div></div>
<div class="ttc" id="aavi__parser_8h_html_a3ece9e152e3d837778a54203fb7477da"><div class="ttname"><a href="avi__parser_8h.html#a3ece9e152e3d837778a54203fb7477da">AVI_VIDS_FLAG</a></div><div class="ttdeci">#define AVI_VIDS_FLAG</div><div class="ttdoc">视频流标志</div><div class="ttdef"><b>Definition:</b> <a href="avi__parser_8h_source.html#l00041">avi_parser.h:41</a></div></div>
<div class="ttc" id="aavi__parser_8h_html_a5fb6196ec8881cca7d4205dff28d5bb7"><div class="ttname"><a href="avi__parser_8h.html#a5fb6196ec8881cca7d4205dff28d5bb7">AVISTATUS</a></div><div class="ttdeci">AVISTATUS</div><div class="ttdoc">错误类型</div><div class="ttdef"><b>Definition:</b> <a href="avi__parser_8h_source.html#l00052">avi_parser.h:53</a></div></div>
<div class="ttc" id="aavi__parser_8h_html_a5fb6196ec8881cca7d4205dff28d5bb7a55b5c2e0d0717e8a2ee2d4d83c04d74e"><div class="ttname"><a href="avi__parser_8h.html#a5fb6196ec8881cca7d4205dff28d5bb7a55b5c2e0d0717e8a2ee2d4d83c04d74e">AVI_OK</a></div><div class="ttdeci">@ AVI_OK</div><div class="ttdoc">0,成功</div><div class="ttdef"><b>Definition:</b> <a href="avi__parser_8h_source.html#l00054">avi_parser.h:54</a></div></div>
<div class="ttc" id="absp__init_8h_html"><div class="ttname"><a href="bsp__init_8h.html">bsp_init.h</a></div><div class="ttdoc">板级硬件外设初始化</div></div>
<div class="ttc" id="adev__dac_8c_html_a1cbb394145c7d8b7a7d17fc24a2d6406"><div class="ttname"><a href="dev__dac_8c.html#a1cbb394145c7d8b7a7d17fc24a2d6406">dac_dma_init</a></div><div class="ttdeci">void dac_dma_init(uint16_t *addr, uint32_t count, uint32_t frequency)</div><div class="ttdoc">DAC_DMA 配置, 采用 TIMR 触发 DMA 步进传输</div><div class="ttdef"><b>Definition:</b> <a href="dev__dac_8c_source.html#l00169">dev_dac.c:169</a></div></div>
<div class="ttc" id="adev__dac_8c_html_a3d600ad47f709a0dcfa5cbf1a00fc31a"><div class="ttname"><a href="dev__dac_8c.html#a3d600ad47f709a0dcfa5cbf1a00fc31a">irq_flag_t</a></div><div class="ttdeci">irq_flag_t</div><div class="ttdoc">中断标志</div><div class="ttdef"><b>Definition:</b> <a href="dev__dac_8c_source.html#l00076">dev_dac.c:77</a></div></div>
<div class="ttc" id="adev__dac_8c_html_a7274a6adbc1a4a9f5a2f27be8d1225e4"><div class="ttname"><a href="dev__dac_8c.html#a7274a6adbc1a4a9f5a2f27be8d1225e4">dac_dma_deinit</a></div><div class="ttdeci">void dac_dma_deinit(void)</div><div class="ttdoc">DAC_DMA 配置恢复初始默认状态</div><div class="ttdef"><b>Definition:</b> <a href="dev__dac_8c_source.html#l00198">dev_dac.c:198</a></div></div>
<div class="ttc" id="adev__dac_8c_html_ab18d2dbe4e762641f948bc31b52234f4"><div class="ttname"><a href="dev__dac_8c.html#ab18d2dbe4e762641f948bc31b52234f4">dac_dma_transfer_done</a></div><div class="ttdeci">uint8_t dac_dma_transfer_done(void)</div><div class="ttdoc">DAC DMA 判断是否传输完成</div><div class="ttdef"><b>Definition:</b> <a href="dev__dac_8c_source.html#l00106">dev_dac.c:106</a></div></div>
<div class="ttc" id="adev__dac_8h_html_a5cf167f3b1930852accd27d796f47195"><div class="ttname"><a href="dev__dac_8h.html#a5cf167f3b1930852accd27d796f47195">DAC_DMA_CHN</a></div><div class="ttdeci">#define DAC_DMA_CHN</div><div class="ttdef"><b>Definition:</b> <a href="dev__dac_8h_source.html#l00028">dev_dac.h:28</a></div></div>
<div class="ttc" id="adev__jpeg_8c_html_a134ecf44573e0f7204be01b09c1e48bb"><div class="ttname"><a href="dev__jpeg_8c.html#a134ecf44573e0f7204be01b09c1e48bb">JPEG_Decoder_Buff</a></div><div class="ttdeci">uint8_t JPEG_Decoder_Buff[512 *1024]</div><div class="ttdoc">使用 JPEG 解码需要一块缓冲区, 大小视图片文件大小决定, 不能小于最大的那张 JPEG 图的大小, 只有在理论极坏情况下会接近原图大小, 因为 JPEG 编码利用人类视觉系统对色彩/高频的不敏感特...</div><div class="ttdef"><b>Definition:</b> <a href="dev__jpeg_8c_source.html#l00034">dev_jpeg.c:35</a></div></div>
<div class="ttc" id="adev__jpeg_8c_html_a1cbc17a98f22c1c19a7d33c85a14fccd"><div class="ttname"><a href="dev__jpeg_8c.html#a1cbc17a98f22c1c19a7d33c85a14fccd">jpeg_decode_isbusy</a></div><div class="ttdeci">uint8_t jpeg_decode_isbusy(void)</div><div class="ttdoc">JPEG 硬件解码忙查询</div><div class="ttdef"><b>Definition:</b> <a href="dev__jpeg_8c_source.html#l00057">dev_jpeg.c:57</a></div></div>
<div class="ttc" id="adev__jpeg_8c_html_ac0e9fc8534c961b9dbba6ad4b8e8b61e"><div class="ttname"><a href="dev__jpeg_8c.html#ac0e9fc8534c961b9dbba6ad4b8e8b61e">jpeg_decode</a></div><div class="ttdeci">void * jpeg_decode(const void *buff, const uint32_t size, const jpeg_outset_t *jpeg_outset, void *(*ram_malloc)(size_t size), const uint8_t wait)</div><div class="ttdoc">JPEG 硬件解码</div><div class="ttdef"><b>Definition:</b> <a href="dev__jpeg_8c_source.html#l00085">dev_jpeg.c:85</a></div></div>
<div class="ttc" id="aload__mv_8c_html_a03ef2b3ebf33b58442ece296ef64254b"><div class="ttname"><a href="load__mv_8c.html#a03ef2b3ebf33b58442ece296ef64254b">FSM_Event_Table</a></div><div class="ttdeci">static const fsm_handle_t FSM_Event_Table[]</div><div class="ttdoc">音视频状态转移表</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00119">load_mv.c:119</a></div></div>
<div class="ttc" id="aload__mv_8c_html_a0beb39d84c085c9baadb8a933edf1e53"><div class="ttname"><a href="load__mv_8c.html#a0beb39d84c085c9baadb8a933edf1e53">cb_parser_wav</a></div><div class="ttdeci">static int cb_parser_wav(void *)</div><div class="ttdoc">解析 wav 音频源</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00705">load_mv.c:705</a></div></div>
<div class="ttc" id="aload__mv_8c_html_a158fc3faa30ddbece4360f3114710212"><div class="ttname"><a href="load__mv_8c.html#a158fc3faa30ddbece4360f3114710212">Debug_FR_Table</a></div><div class="ttdeci">static const char * Debug_FR_Table[]</div><div class="ttdoc">FATFS 文件系统 Debug 表</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00165">load_mv.c:165</a></div></div>
<div class="ttc" id="aload__mv_8c_html_a23bd76710e0085785dc0c07eee9f562b"><div class="ttname"><a href="load__mv_8c.html#a23bd76710e0085785dc0c07eee9f562b">Audio_Control</a></div><div class="ttdeci">static ppbuf_t Audio_Control</div><div class="ttdoc">音频数据乒乓操作句柄</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00145">load_mv.c:145</a></div></div>
<div class="ttc" id="aload__mv_8c_html_a26fdaf5976717811bbc2342599b1da4b"><div class="ttname"><a href="load__mv_8c.html#a26fdaf5976717811bbc2342599b1da4b">video_outset_format</a></div><div class="ttdeci">void video_outset_format(uint8_t format, uint8_t rgb565_dither)</div><div class="ttdoc">设置视频解码输出格式</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00381">load_mv.c:381</a></div></div>
<div class="ttc" id="aload__mv_8c_html_a270fa9b5805fcc89bfb0c3f0bcf77c4d"><div class="ttname"><a href="load__mv_8c.html#a270fa9b5805fcc89bfb0c3f0bcf77c4d">Restart_Stream_ID</a></div><div class="ttdeci">static uint32_t Restart_Stream_ID</div><div class="ttdoc">流起始数据类型</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00152">load_mv.c:152</a></div></div>
<div class="ttc" id="aload__mv_8c_html_a2877cfdf885996dd8831a2a37660352d"><div class="ttname"><a href="load__mv_8c.html#a2877cfdf885996dd8831a2a37660352d">mv_task_pause</a></div><div class="ttdeci">void mv_task_pause(void)</div><div class="ttdoc">暂停播放</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00292">load_mv.c:292</a></div></div>
<div class="ttc" id="aload__mv_8c_html_a319fc11a86458ae8f312ba52f686483c"><div class="ttname"><a href="load__mv_8c.html#a319fc11a86458ae8f312ba52f686483c">video_set_post</a></div><div class="ttdeci">void video_set_post(lcd_layer_t lcd_layer, uint16_t xs, uint16_t ys)</div><div class="ttdoc">设置视频播放显示区域</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00395">load_mv.c:395</a></div></div>
<div class="ttc" id="aload__mv_8c_html_a35c6cf21059ba899b846d63b5224dc54"><div class="ttname"><a href="load__mv_8c.html#a35c6cf21059ba899b846d63b5224dc54">TIMR_AVI</a></div><div class="ttdeci">#define TIMR_AVI</div><div class="ttdoc">avi 视频播放用定时器</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00060">load_mv.c:60</a></div></div>
<div class="ttc" id="aload__mv_8c_html_a3a29f68f2d856a9c2eea3a328d5233e8"><div class="ttname"><a href="load__mv_8c.html#a3a29f68f2d856a9c2eea3a328d5233e8">cb_decode_avi</a></div><div class="ttdeci">static int cb_decode_avi(void *)</div><div class="ttdoc">解码 avi 视频播放</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00770">load_mv.c:770</a></div></div>
<div class="ttc" id="aload__mv_8c_html_a3a3e1add9e325bafcb5ce220c4cf75bd"><div class="ttname"><a href="load__mv_8c.html#a3a3e1add9e325bafcb5ce220c4cf75bd">Audio_PCM_Buff</a></div><div class="ttdeci">static int16_t Audio_PCM_Buff[PCM_BUFSIZE *2]</div><div class="ttdoc">音频数据缓存</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00143">load_mv.c:143</a></div></div>
<div class="ttc" id="aload__mv_8c_html_a3d600ad47f709a0dcfa5cbf1a00fc31a"><div class="ttname"><a href="load__mv_8c.html#a3d600ad47f709a0dcfa5cbf1a00fc31a">irq_flag_t</a></div><div class="ttdeci">irq_flag_t</div><div class="ttdoc">中断标志</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00097">load_mv.c:98</a></div></div>
<div class="ttc" id="aload__mv_8c_html_a3d600ad47f709a0dcfa5cbf1a00fc31aa0d077f5b932ce05e5b9f30c6087a2f31"><div class="ttname"><a href="load__mv_8c.html#a3d600ad47f709a0dcfa5cbf1a00fc31aa0d077f5b932ce05e5b9f30c6087a2f31">NO</a></div><div class="ttdeci">@ NO</div><div class="ttdoc">未触发中断</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00099">load_mv.c:99</a></div></div>
<div class="ttc" id="aload__mv_8c_html_a3d600ad47f709a0dcfa5cbf1a00fc31aa2bc49ec37d6a5715dd23e85f1ff5bb59"><div class="ttname"><a href="load__mv_8c.html#a3d600ad47f709a0dcfa5cbf1a00fc31aa2bc49ec37d6a5715dd23e85f1ff5bb59">OK</a></div><div class="ttdeci">@ OK</div><div class="ttdoc">已触发中断</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00102">load_mv.c:100</a></div></div>
<div class="ttc" id="aload__mv_8c_html_a3ff08970bdf7f8e28122786eac11d6d3"><div class="ttname"><a href="load__mv_8c.html#a3ff08970bdf7f8e28122786eac11d6d3">video_set_loop</a></div><div class="ttdeci">void video_set_loop(const uint32_t times, const uint32_t max)</div><div class="ttdoc">设置视频循环播放次数</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00431">load_mv.c:431</a></div></div>
<div class="ttc" id="aload__mv_8c_html_a466f231c4630e48f95aa5980f6d0cc42"><div class="ttname"><a href="load__mv_8c.html#a466f231c4630e48f95aa5980f6d0cc42">Restart_Offset</a></div><div class="ttdeci">static uint32_t Restart_Offset</div><div class="ttdoc">流起始数据偏移量</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00153">load_mv.c:153</a></div></div>
<div class="ttc" id="aload__mv_8c_html_a47fdfbb31eda448a7ec364e2e724c2b7"><div class="ttname"><a href="load__mv_8c.html#a47fdfbb31eda448a7ec364e2e724c2b7">Video_Loop_Nums</a></div><div class="ttdeci">static volatile uint32_t Video_Loop_Nums</div><div class="ttdoc">当前视频已循环播放次数</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00155">load_mv.c:155</a></div></div>
<div class="ttc" id="aload__mv_8c_html_a492fd8587926eace74ba1054485d66b5"><div class="ttname"><a href="load__mv_8c.html#a492fd8587926eace74ba1054485d66b5">IRQ_Flag_Frame</a></div><div class="ttdeci">static volatile irq_flag_t IRQ_Flag_Frame</div><div class="ttdoc">帧率标志</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00159">load_mv.c:159</a></div></div>
<div class="ttc" id="aload__mv_8c_html_a493217321e8eec123f3a1a788dddcf11"><div class="ttname"><a href="load__mv_8c.html#a493217321e8eec123f3a1a788dddcf11">fsm_event_t</a></div><div class="ttdeci">fsm_event_t</div><div class="ttdoc">音视频事件</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00087">load_mv.c:88</a></div></div>
<div class="ttc" id="aload__mv_8c_html_a493217321e8eec123f3a1a788dddcf11a0006b5f2d91ef6c7cdbff7065bdbd49e"><div class="ttname"><a href="load__mv_8c.html#a493217321e8eec123f3a1a788dddcf11a0006b5f2d91ef6c7cdbff7065bdbd49e">fsm_event_parser_avi</a></div><div class="ttdeci">@ fsm_event_parser_avi</div><div class="ttdoc">解析 avi 头</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00090">load_mv.c:90</a></div></div>
<div class="ttc" id="aload__mv_8c_html_a493217321e8eec123f3a1a788dddcf11a0eebdd5efb02ae138999a818a5ace4a0"><div class="ttname"><a href="load__mv_8c.html#a493217321e8eec123f3a1a788dddcf11a0eebdd5efb02ae138999a818a5ace4a0">fsm_event_idle</a></div><div class="ttdeci">@ fsm_event_idle</div><div class="ttdoc">空闲挂起(特权级)</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00089">load_mv.c:89</a></div></div>
<div class="ttc" id="aload__mv_8c_html_a493217321e8eec123f3a1a788dddcf11a170564aa26b89d074cf288e97ba94209"><div class="ttname"><a href="load__mv_8c.html#a493217321e8eec123f3a1a788dddcf11a170564aa26b89d074cf288e97ba94209">fsm_event_close</a></div><div class="ttdeci">@ fsm_event_close</div><div class="ttdoc">关闭</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00094">load_mv.c:93</a></div></div>
<div class="ttc" id="aload__mv_8c_html_a493217321e8eec123f3a1a788dddcf11ade45d40e28be11dd81a75ab2f78f9a9f"><div class="ttname"><a href="load__mv_8c.html#a493217321e8eec123f3a1a788dddcf11ade45d40e28be11dd81a75ab2f78f9a9f">fsm_event_decode</a></div><div class="ttdeci">@ fsm_event_decode</div><div class="ttdoc">解码</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00092">load_mv.c:92</a></div></div>
<div class="ttc" id="aload__mv_8c_html_a493217321e8eec123f3a1a788dddcf11ae7d904538ea9727252edd4bd8d44a30d"><div class="ttname"><a href="load__mv_8c.html#a493217321e8eec123f3a1a788dddcf11ae7d904538ea9727252edd4bd8d44a30d">fsm_event_parser_wav</a></div><div class="ttdeci">@ fsm_event_parser_wav</div><div class="ttdoc">解析 wav 头</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00091">load_mv.c:91</a></div></div>
<div class="ttc" id="aload__mv_8c_html_a4baf0d2c0d6e1fea0ddb9867c9747f8b"><div class="ttname"><a href="load__mv_8c.html#a4baf0d2c0d6e1fea0ddb9867c9747f8b">mv_task_handler</a></div><div class="ttdeci">int mv_task_handler(void)</div><div class="ttdoc">音视频任务处理</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00211">load_mv.c:211</a></div></div>
<div class="ttc" id="aload__mv_8c_html_a4dad906d6569beca6b524a122e5ebb11"><div class="ttname"><a href="load__mv_8c.html#a4dad906d6569beca6b524a122e5ebb11">File_Handle</a></div><div class="ttdeci">static FIL File_Handle</div><div class="ttdoc">文件句柄</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00151">load_mv.c:151</a></div></div>
<div class="ttc" id="aload__mv_8c_html_a6be0f2908cc5e6f47baae4138c8be510"><div class="ttname"><a href="load__mv_8c.html#a6be0f2908cc5e6f47baae4138c8be510">lcd_set_color_key</a></div><div class="ttdeci">void lcd_set_color_key(lcd_layer_t lcd_layer, uint8_t color_key_enable, uint32_t rgb)</div><div class="ttdoc">设置图层色键控</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00351">load_mv.c:351</a></div></div>
<div class="ttc" id="aload__mv_8c_html_a6ce56145e8e2449ba3049c2a622e84b6"><div class="ttname"><a href="load__mv_8c.html#a6ce56145e8e2449ba3049c2a622e84b6">isr_btimer_avi</a></div><div class="ttdeci">void isr_btimer_avi(void)</div><div class="ttdoc">Timer ISR Callback (AVI 视频帧率控制)</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00196">load_mv.c:196</a></div></div>
<div class="ttc" id="aload__mv_8c_html_a79e1ebe637dcb48c69706eb81c73b576"><div class="ttname"><a href="load__mv_8c.html#a79e1ebe637dcb48c69706eb81c73b576">cb_close_wav</a></div><div class="ttdeci">static int cb_close_wav(void *)</div><div class="ttdoc">关闭 wav 音频, 并释放所占用的资源</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00521">load_mv.c:521</a></div></div>
<div class="ttc" id="aload__mv_8c_html_a7b04ea3ab24f188f71239a1d3b808030"><div class="ttname"><a href="load__mv_8c.html#a7b04ea3ab24f188f71239a1d3b808030">FSM</a></div><div class="ttdeci">static fsm_t FSM</div><div class="ttdoc">音视频状态机句柄</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00134">load_mv.c:134</a></div></div>
<div class="ttc" id="aload__mv_8c_html_a7dd8d59698dc593d41250fc09a0ae5a5"><div class="ttname"><a href="load__mv_8c.html#a7dd8d59698dc593d41250fc09a0ae5a5">mv_task_init</a></div><div class="ttdeci">void mv_task_init(const char *file_path)</div><div class="ttdoc">打开源文件启动播放</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00260">load_mv.c:260</a></div></div>
<div class="ttc" id="aload__mv_8c_html_a904f1d788d926c7864c948c4f9d1c66f"><div class="ttname"><a href="load__mv_8c.html#a904f1d788d926c7864c948c4f9d1c66f">cb_parser_avi</a></div><div class="ttdeci">static int cb_parser_avi(void *)</div><div class="ttdoc">解析 avi 视频源</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00533">load_mv.c:533</a></div></div>
<div class="ttc" id="aload__mv_8c_html_a913dfd46ff07efd13423f77b143fd156"><div class="ttname"><a href="load__mv_8c.html#a913dfd46ff07efd13423f77b143fd156">mv_task_resume</a></div><div class="ttdeci">void mv_task_resume(void)</div><div class="ttdoc">恢复播放</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00308">load_mv.c:308</a></div></div>
<div class="ttc" id="aload__mv_8c_html_a978ed993bd878f76db92c810771c0ee8"><div class="ttname"><a href="load__mv_8c.html#a978ed993bd878f76db92c810771c0ee8">cb_close_avi</a></div><div class="ttdeci">static int cb_close_avi(void *)</div><div class="ttdoc">关闭 avi 视频, 并释放所占用的资源</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00482">load_mv.c:482</a></div></div>
<div class="ttc" id="aload__mv_8c_html_a9cbedc9a40c34ca836f988cc88f5640f"><div class="ttname"><a href="load__mv_8c.html#a9cbedc9a40c34ca836f988cc88f5640f">lcd_set_alpha</a></div><div class="ttdeci">void lcd_set_alpha(lcd_layer_t lcd_layer, uint8_t alpha)</div><div class="ttdoc">设置图层透明度</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00335">load_mv.c:335</a></div></div>
<div class="ttc" id="aload__mv_8c_html_aa7c703137502abaebf7487b6d19a7565"><div class="ttname"><a href="load__mv_8c.html#aa7c703137502abaebf7487b6d19a7565">PCM_BUFSIZE</a></div><div class="ttdeci">#define PCM_BUFSIZE</div><div class="ttdoc">此处直接定义成2048，比较好的方法应该是根据 wav/avi 文件头解析出的大小在堆中申请空间</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00065">load_mv.c:65</a></div></div>
<div class="ttc" id="aload__mv_8c_html_ab03d657977c16952b0a16e589fbd6e71"><div class="ttname"><a href="load__mv_8c.html#ab03d657977c16952b0a16e589fbd6e71">mv_task_over</a></div><div class="ttdeci">void mv_task_over(void)</div><div class="ttdoc">结束播放, 释放所占用的资源</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00224">load_mv.c:224</a></div></div>
<div class="ttc" id="aload__mv_8c_html_ab3b1a7d6c03074968fcdfa784fe8fe14"><div class="ttname"><a href="load__mv_8c.html#ab3b1a7d6c03074968fcdfa784fe8fe14">video_center_with_tp</a></div><div class="ttdeci">void video_center_with_tp(uint16_t x, uint16_t y)</div><div class="ttdoc">视频中心跟随触摸移动</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00458">load_mv.c:458</a></div></div>
<div class="ttc" id="aload__mv_8c_html_abd1e47f634a69dfe15a08cf0ca6219b0"><div class="ttname"><a href="load__mv_8c.html#abd1e47f634a69dfe15a08cf0ca6219b0">MV_LOG</a></div><div class="ttdeci">#define MV_LOG(...)</div><div class="ttdoc">模块调试日志打印宏</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00054">load_mv.c:54</a></div></div>
<div class="ttc" id="aload__mv_8c_html_abe5464036c09e633ce1a409d40e11164"><div class="ttname"><a href="load__mv_8c.html#abe5464036c09e633ce1a409d40e11164">video_get_loop</a></div><div class="ttdeci">void video_get_loop(uint32_t *times, uint32_t *max)</div><div class="ttdoc">获取视频循环播放次数</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00442">load_mv.c:442</a></div></div>
<div class="ttc" id="aload__mv_8c_html_abe7750a41e8ce4686680033dcc321cec"><div class="ttname"><a href="load__mv_8c.html#abe7750a41e8ce4686680033dcc321cec">Event_ID</a></div><div class="ttdeci">static fsm_event_t Event_ID</div><div class="ttdoc">音视频触发事件</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00140">load_mv.c:140</a></div></div>
<div class="ttc" id="aload__mv_8c_html_acc289e18199098eb1e60099e71ce5476"><div class="ttname"><a href="load__mv_8c.html#acc289e18199098eb1e60099e71ce5476">Video_OutSet</a></div><div class="ttdeci">static jpeg_outset_t Video_OutSet</div><div class="ttdoc">视频播放中 JPEG 解码输出设定</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00148">load_mv.c:148</a></div></div>
<div class="ttc" id="aload__mv_8c_html_adc415ff7c829fa6c6a78755deccbc10d"><div class="ttname"><a href="load__mv_8c.html#adc415ff7c829fa6c6a78755deccbc10d">Video_Loop_Max</a></div><div class="ttdeci">static volatile uint32_t Video_Loop_Max</div><div class="ttdoc">视频循环播放次数上限( uint32_t )</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00156">load_mv.c:156</a></div></div>
<div class="ttc" id="aload__mv_8c_html_ade87c0786f4382f3e221f3a79cef3a01"><div class="ttname"><a href="load__mv_8c.html#ade87c0786f4382f3e221f3a79cef3a01">cb_decode_wav</a></div><div class="ttdeci">static int cb_decode_wav(void *)</div><div class="ttdoc">解码 wav 音频播放</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00858">load_mv.c:858</a></div></div>
<div class="ttc" id="aload__mv_8c_html_adf6b06c522e8f78610aa821eff3a2508"><div class="ttname"><a href="load__mv_8c.html#adf6b06c522e8f78610aa821eff3a2508">Restart_StreamSize</a></div><div class="ttdeci">static uint32_t Restart_StreamSize</div><div class="ttdoc">流起始的数据大小</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00154">load_mv.c:154</a></div></div>
<div class="ttc" id="aload__mv_8c_html_aefd70b8b91d72cbd548b6c38f385983b"><div class="ttname"><a href="load__mv_8c.html#aefd70b8b91d72cbd548b6c38f385983b">fsm_state_t</a></div><div class="ttdeci">fsm_state_t</div><div class="ttdoc">音视频播放状态</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00079">load_mv.c:80</a></div></div>
<div class="ttc" id="aload__mv_8c_html_aefd70b8b91d72cbd548b6c38f385983ba670e07d99593e66c665616d780ffb00e"><div class="ttname"><a href="load__mv_8c.html#aefd70b8b91d72cbd548b6c38f385983ba670e07d99593e66c665616d780ffb00e">fsm_state_run_avi</a></div><div class="ttdeci">@ fsm_state_run_avi</div><div class="ttdoc">运行态-avi</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00082">load_mv.c:82</a></div></div>
<div class="ttc" id="aload__mv_8c_html_aefd70b8b91d72cbd548b6c38f385983bab470eb20dd049d7bdce38bc9ae5f0db1"><div class="ttname"><a href="load__mv_8c.html#aefd70b8b91d72cbd548b6c38f385983bab470eb20dd049d7bdce38bc9ae5f0db1">fsm_state_idle</a></div><div class="ttdeci">@ fsm_state_idle</div><div class="ttdoc">空闲态</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00081">load_mv.c:81</a></div></div>
<div class="ttc" id="aload__mv_8c_html_aefd70b8b91d72cbd548b6c38f385983bad9853dc519c747cd4515e80a7b242ea8"><div class="ttname"><a href="load__mv_8c.html#aefd70b8b91d72cbd548b6c38f385983bad9853dc519c747cd4515e80a7b242ea8">fsm_state_run_wav</a></div><div class="ttdeci">@ fsm_state_run_wav</div><div class="ttdoc">运行态-wav</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00084">load_mv.c:83</a></div></div>
<div class="ttc" id="aload__mv_8h_html"><div class="ttname"><a href="load__mv_8h.html">load_mv.h</a></div><div class="ttdoc">播放 avi / wav 音视频</div></div>
<div class="ttc" id="aload__mv_8h_html_ab9806189ae8983878b4853db01912f47"><div class="ttname"><a href="load__mv_8h.html#ab9806189ae8983878b4853db01912f47">lcd_layer_t</a></div><div class="ttdeci">lcd_layer_t</div><div class="ttdoc">显示图层枚举(详见 swm341_lcd.h)</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8h_source.html#l00041">load_mv.h:42</a></div></div>
<div class="ttc" id="aload__mv_8h_html_ab9806189ae8983878b4853db01912f47a007207a8bae3c327ad4531fa3e5fac93"><div class="ttname"><a href="load__mv_8h.html#ab9806189ae8983878b4853db01912f47a007207a8bae3c327ad4531fa3e5fac93">LAYER_1_GUI</a></div><div class="ttdeci">@ LAYER_1_GUI</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8h_source.html#l00043">load_mv.h:43</a></div></div>
<div class="ttc" id="aload__mv_8h_html_ab9806189ae8983878b4853db01912f47a385d7e8b722132d2e22f31b06e30be97"><div class="ttname"><a href="load__mv_8h.html#ab9806189ae8983878b4853db01912f47a385d7e8b722132d2e22f31b06e30be97">LAYER_2_VIDEO</a></div><div class="ttdeci">@ LAYER_2_VIDEO</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8h_source.html#l00045">load_mv.h:44</a></div></div>
<div class="ttc" id="alog_8h_html"><div class="ttname"><a href="log_8h.html">log.h</a></div><div class="ttdoc">日志打印/用户提示(告警)</div></div>
<div class="ttc" id="amem__sdram_8c_html_a5518679ba96822661667b2b3d5182379"><div class="ttname"><a href="mem__sdram_8c.html#a5518679ba96822661667b2b3d5182379">sdram_get_idle_size</a></div><div class="ttdeci">size_t sdram_get_idle_size(void)</div><div class="ttdoc">获取空闲可用内存大小</div><div class="ttdef"><b>Definition:</b> <a href="mem__sdram_8c_source.html#l00231">mem_sdram.c:231</a></div></div>
<div class="ttc" id="amem__sdram_8c_html_a9ef7e7053d4000fe99a7eacc8d9346d7"><div class="ttname"><a href="mem__sdram_8c.html#a9ef7e7053d4000fe99a7eacc8d9346d7">sdram_free</a></div><div class="ttdeci">uint8_t sdram_free(void *ptr)</div><div class="ttdoc">释放一块内存</div><div class="ttdef"><b>Definition:</b> <a href="mem__sdram_8c_source.html#l00183">mem_sdram.c:183</a></div></div>
<div class="ttc" id="amem__sdram_8c_html_ae1630464a6d7686e9e41daf4b38e74a8"><div class="ttname"><a href="mem__sdram_8c.html#ae1630464a6d7686e9e41daf4b38e74a8">sdram_malloc</a></div><div class="ttdeci">void * sdram_malloc(size_t size)</div><div class="ttdoc">申请一块内存</div><div class="ttdef"><b>Definition:</b> <a href="mem__sdram_8c_source.html#l00130">mem_sdram.c:130</a></div></div>
<div class="ttc" id="amem__sdram_8h_html"><div class="ttname"><a href="mem__sdram_8h.html">mem_sdram.h</a></div><div class="ttdoc">管理片内 SDRAM 存储空间</div></div>
<div class="ttc" id="aposix__fsm_8c_html_a02397a7a821d3ddd678b34eea5e94054"><div class="ttname"><a href="posix__fsm_8c.html#a02397a7a821d3ddd678b34eea5e94054">fsm_state_get</a></div><div class="ttdeci">fsm_result fsm_state_get(fsm_t *fsm, int *state)</div><div class="ttdoc">获取当前状态</div><div class="ttdef"><b>Definition:</b> <a href="posix__fsm_8c_source.html#l00038">posix_fsm.c:38</a></div></div>
<div class="ttc" id="aposix__fsm_8c_html_a0b1b28d5d26c97b4c934f7822c1a7a04"><div class="ttname"><a href="posix__fsm_8c.html#a0b1b28d5d26c97b4c934f7822c1a7a04">fsm_event_exec</a></div><div class="ttdeci">fsm_result fsm_event_exec(fsm_t *fsm, int event, void *data)</div><div class="ttdoc">当指定事件触发时, 状态机会自动寻找并调用对应的动作处理回调, 从而完成状态转移</div><div class="ttdef"><b>Definition:</b> <a href="posix__fsm_8c_source.html#l00098">posix_fsm.c:98</a></div></div>
<div class="ttc" id="aposix__fsm_8h_html"><div class="ttname"><a href="posix__fsm_8h.html">posix_fsm.h</a></div><div class="ttdoc">有限状态机实现</div></div>
<div class="ttc" id="aposix__fsm_8h_html_a21f736acd6f712522de85c096c7ec091"><div class="ttname"><a href="posix__fsm_8h.html#a21f736acd6f712522de85c096c7ec091">fsm_result</a></div><div class="ttdeci">fsm_result</div><div class="ttdef"><b>Definition:</b> <a href="posix__fsm_8h_source.html#l00042">posix_fsm.h:42</a></div></div>
<div class="ttc" id="aposix__fsm_8h_html_a21f736acd6f712522de85c096c7ec091aabaf50596722b188e2a14557e0de4630"><div class="ttname"><a href="posix__fsm_8h.html#a21f736acd6f712522de85c096c7ec091aabaf50596722b188e2a14557e0de4630">FSM_RT_OK</a></div><div class="ttdeci">@ FSM_RT_OK</div><div class="ttdoc">成功</div><div class="ttdef"><b>Definition:</b> <a href="posix__fsm_8h_source.html#l00043">posix_fsm.h:43</a></div></div>
<div class="ttc" id="astruct_a_v_i___i_n_f_o_html_a3bdc883455d9732f65c9d4cb1aebe28b"><div class="ttname"><a href="struct_a_v_i___i_n_f_o.html#a3bdc883455d9732f65c9d4cb1aebe28b">AVI_INFO::Height</a></div><div class="ttdeci">uint32_t Height</div><div class="ttdoc">图像高</div><div class="ttdef"><b>Definition:</b> <a href="avi__parser_8h_source.html#l00074">avi_parser.h:74</a></div></div>
<div class="ttc" id="astruct_a_v_i___i_n_f_o_html_a780dbba77a0f21fe07b1facf6aba3dd3"><div class="ttname"><a href="struct_a_v_i___i_n_f_o.html#a780dbba77a0f21fe07b1facf6aba3dd3">AVI_INFO::SecPerFrame</a></div><div class="ttdeci">uint32_t SecPerFrame</div><div class="ttdoc">视频帧间隔时间(单位为us)</div><div class="ttdef"><b>Definition:</b> <a href="avi__parser_8h_source.html#l00071">avi_parser.h:71</a></div></div>
<div class="ttc" id="astruct_a_v_i___i_n_f_o_html_a930ec675cfdc1a0f18f3414583f7b950"><div class="ttname"><a href="struct_a_v_i___i_n_f_o.html#a930ec675cfdc1a0f18f3414583f7b950">AVI_INFO::SampleRate</a></div><div class="ttdeci">uint32_t SampleRate</div><div class="ttdoc">音频采样率</div><div class="ttdef"><b>Definition:</b> <a href="avi__parser_8h_source.html#l00075">avi_parser.h:75</a></div></div>
<div class="ttc" id="astruct_a_v_i___i_n_f_o_html_ad672690f555bb08866a491753109e551"><div class="ttname"><a href="struct_a_v_i___i_n_f_o.html#ad672690f555bb08866a491753109e551">AVI_INFO::Width</a></div><div class="ttdeci">uint32_t Width</div><div class="ttdoc">图像宽</div><div class="ttdef"><b>Definition:</b> <a href="avi__parser_8h_source.html#l00073">avi_parser.h:73</a></div></div>
<div class="ttc" id="astruct_a_v_i___i_n_f_o_html_ae256ff66a407ed8f0a929b4159c91871"><div class="ttname"><a href="struct_a_v_i___i_n_f_o.html#ae256ff66a407ed8f0a929b4159c91871">AVI_INFO::AudioBufSize</a></div><div class="ttdeci">uint16_t AudioBufSize</div><div class="ttdoc">音频缓冲区大小</div><div class="ttdef"><b>Definition:</b> <a href="avi__parser_8h_source.html#l00077">avi_parser.h:77</a></div></div>
<div class="ttc" id="astruct_a_v_i___i_n_f_o_html_ae9f33841c7538c99150077f9c04d7070"><div class="ttname"><a href="struct_a_v_i___i_n_f_o.html#ae9f33841c7538c99150077f9c04d7070">AVI_INFO::StreamSize</a></div><div class="ttdeci">uint32_t StreamSize</div><div class="ttdoc">流大小,必须是偶数,如果读取到为奇数,则加1.</div><div class="ttdef"><b>Definition:</b> <a href="avi__parser_8h_source.html#l00080">avi_parser.h:80</a></div></div>
<div class="ttc" id="astruct_a_v_i___i_n_f_o_html_aebe839b9a64cd04e96f275be975f3661"><div class="ttname"><a href="struct_a_v_i___i_n_f_o.html#aebe839b9a64cd04e96f275be975f3661">AVI_INFO::StreamID</a></div><div class="ttdeci">uint16_t StreamID</div><div class="ttdoc">流类型ID,StreamID=='dc'==0X6463 /StreamID=='wb'==0X7762</div><div class="ttdef"><b>Definition:</b> <a href="avi__parser_8h_source.html#l00079">avi_parser.h:79</a></div></div>
<div class="ttc" id="astruct_w_a_v___i_n_f_o_html_a370f2f23a5016862b7862b5e90f90842"><div class="ttname"><a href="struct_w_a_v___i_n_f_o.html#a370f2f23a5016862b7862b5e90f90842">WAV_INFO::samplerate</a></div><div class="ttdeci">uint32_t samplerate</div><div class="ttdoc">采样率</div><div class="ttdef"><b>Definition:</b> <a href="wav__parser_8h_source.html#l00087">wav_parser.h:87</a></div></div>
<div class="ttc" id="astruct_w_a_v___i_n_f_o_html_ad724f0361ba01c7bfb66c62592612538"><div class="ttname"><a href="struct_w_a_v___i_n_f_o.html#ad724f0361ba01c7bfb66c62592612538">WAV_INFO::datastart</a></div><div class="ttdeci">uint32_t datastart</div><div class="ttdoc">数据帧开始的位置(在文件里面的偏移)</div><div class="ttdef"><b>Definition:</b> <a href="wav__parser_8h_source.html#l00090">wav_parser.h:90</a></div></div>
<div class="ttc" id="astructfsm__handle__t_html"><div class="ttname"><a href="structfsm__handle__t.html">fsm_handle_t</a></div><div class="ttdef"><b>Definition:</b> <a href="posix__fsm_8h_source.html#l00056">posix_fsm.h:56</a></div></div>
<div class="ttc" id="astructfsm__t_html"><div class="ttname"><a href="structfsm__t.html">fsm_t</a></div><div class="ttdef"><b>Definition:</b> <a href="posix__fsm_8h_source.html#l00064">posix_fsm.h:64</a></div></div>
<div class="ttc" id="astructfsm__t_html_a1de5159247bef46fcdced877da3efdea"><div class="ttname"><a href="structfsm__t.html#a1de5159247bef46fcdced877da3efdea">fsm_t::table</a></div><div class="ttdeci">fsm_handle_t * table</div><div class="ttdoc">状态迁移表</div><div class="ttdef"><b>Definition:</b> <a href="posix__fsm_8h_source.html#l00066">posix_fsm.h:66</a></div></div>
<div class="ttc" id="astructppbuf__t_html"><div class="ttname"><a href="structppbuf__t.html">ppbuf_t</a></div><div class="ttdoc">ping pong buffer control structure(乒乓双缓冲)</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00071">load_mv.c:72</a></div></div>
<div class="ttc" id="astructppbuf__t_html_a29d6f26ef78cbf28c7570503a278b73d"><div class="ttname"><a href="structppbuf__t.html#a29d6f26ef78cbf28c7570503a278b73d">ppbuf_t::pong</a></div><div class="ttdeci">volatile uint8_t pong</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00075">load_mv.c:75</a></div></div>
<div class="ttc" id="astructppbuf__t_html_aba0654c8fda9f3e4182659c72e1f3942"><div class="ttname"><a href="structppbuf__t.html#aba0654c8fda9f3e4182659c72e1f3942">ppbuf_t::buf</a></div><div class="ttdeci">int16_t * buf</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00073">load_mv.c:73</a></div></div>
<div class="ttc" id="astructppbuf__t_html_ae68c54fbb92dacb8fa2a18389de52f9f"><div class="ttname"><a href="structppbuf__t.html#ae68c54fbb92dacb8fa2a18389de52f9f">ppbuf_t::ping</a></div><div class="ttdeci">volatile uint8_t ping</div><div class="ttdef"><b>Definition:</b> <a href="load__mv_8c_source.html#l00074">load_mv.c:74</a></div></div>
<div class="ttc" id="aversion_8h_html_a13286deaebfd1c39a4e3638e8718c274"><div class="ttname"><a href="version_8h.html#a13286deaebfd1c39a4e3638e8718c274">LCD_VDOT</a></div><div class="ttdeci">#define LCD_VDOT</div><div class="ttdef"><b>Definition:</b> <a href="version_8h_source.html#l00189">version.h:189</a></div></div>
<div class="ttc" id="aversion_8h_html_a23a8c652045ed1831883b0c6785bea16"><div class="ttname"><a href="version_8h.html#a23a8c652045ed1831883b0c6785bea16">LCD_HDOT</a></div><div class="ttdeci">#define LCD_HDOT</div><div class="ttdef"><b>Definition:</b> <a href="version_8h_source.html#l00188">version.h:188</a></div></div>
<div class="ttc" id="aversion_8h_html_ae3f7a8bd03ba0b575f7ece837aab91aa"><div class="ttname"><a href="version_8h.html#ae3f7a8bd03ba0b575f7ece837aab91aa">LCD_FMT</a></div><div class="ttdeci">#define LCD_FMT</div><div class="ttdoc">enum : LCD 显示格式(LCD_FORMAT) 其值为一个像素点所占用的字节数, 可使用该值结合分辨率计算一帧显示缓存的大小</div><div class="ttdef"><b>Definition:</b> <a href="version_8h_source.html#l00246">version.h:246</a></div></div>
<div class="ttc" id="awav__parser_8c_html_aac71309979edec17487770ba9f4650a6"><div class="ttname"><a href="wav__parser_8c.html#aac71309979edec17487770ba9f4650a6">Wavx</a></div><div class="ttdeci">WAV_INFO Wavx</div><div class="ttdoc">WAV 音频流信息</div><div class="ttdef"><b>Definition:</b> <a href="wav__parser_8c_source.html#l00035">wav_parser.c:35</a></div></div>
<div class="ttc" id="awav__parser_8c_html_acc10199929987de81dc6d395c39832c0"><div class="ttname"><a href="wav__parser_8c.html#acc10199929987de81dc6d395c39832c0">wav_init</a></div><div class="ttdeci">int32_t wav_init(uint8_t *buf, uint32_t len)</div><div class="ttdoc">wav 音频解析</div><div class="ttdef"><b>Definition:</b> <a href="wav__parser_8c_source.html#l00045">wav_parser.c:45</a></div></div>
<div class="ttc" id="awav__parser_8h_html"><div class="ttname"><a href="wav__parser_8h.html">wav_parser.h</a></div><div class="ttdoc">wav 音频格式解析</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.5
</small></address>
</body>
</html>
